Can You Implement a Rollback Feature in a MATLAB Program?

  • Context: MATLAB 
  • Thread starter Thread starter elbarto
  • Start date Start date
  • Tags Tags
    Frame Matlab Program
Click For Summary

Discussion Overview

The discussion centers around implementing a rollback feature in a MATLAB program designed for solving member forces in a 2D frame structure. Participants explore ways to enhance user input handling to avoid repetitive data entry due to mistakes.

Discussion Character

  • Exploratory
  • Technical explanation
  • Conceptual clarification

Main Points Raised

  • Elbarto describes the challenge of entering multiple user inputs and the frustration of having to re-enter all previous inputs if a mistake is made.
  • Some participants suggest breaking the code into logical sections and presenting all inputs to the user for confirmation before proceeding, allowing for corrections to be made easily.
  • Others inquire about obtaining the source code for the MATLAB program, indicating interest in the implementation details.

Areas of Agreement / Disagreement

There is no consensus on a specific rollback implementation, but participants agree on the need for improved user input management. Multiple suggestions for handling user input have been proposed, but no single solution has been established.

Contextual Notes

The discussion does not address specific programming limitations or the feasibility of proposed solutions in detail.

elbarto
Messages
32
Reaction score
0
Hi,
I have been working on a MATLAB program for solving the member forces in a 2d frame structure which many people have helped me out with on this forum. I have finally got the script to a point where it is working ok and have shown the command window output for a solving a simple frame.

My question is, is there a way you can "rollback" on a user input? My program requires the user make many inputs and it is very easy to make a mistake, which is frustrating because you must then enter the 20+ previous inputs again. So, if there is an option to rollback to the previous input it would be extreamly usefull.

Thank You
Elbarto








<<<<<<<<<<<<<<<<<<Enter Node Geometry, Number of members>>>>>>>>>>>>>>>>>>
Enter Number Of Nodes:3
Enter X Co-Ordinate of Node 1:0
Enter Y Co-Ordinate of Node 1:0
Enter X Co-Ordinate of Node 2:100
Enter Y Co-Ordinate of Node 2:0
Enter X Co-Ordinate of Node 3:200
Enter Y Co-Ordinate of Node 3:-75
Enter Number Of Members:2
Enter Node i for Member 1:1
Enter Node j for Member 1:2
Enter Node i for Member 2:2
Enter Node j for Member 2:3
<<<<<<<<<<<<<<<<<<Section properties>>>>>>>>>>>>>>>>>>
Enter E for material {enter 0 for steel}:1e4
Do you wish to use more then 1 section [y/n]?:n
Enter Area m^2 for all members:10
Enter Second Moment of Area (m^4) for all Members:1e3
<<<<<<<<<<<<<<<<<<Member Releases>>>>>>>>>>>>>>>>>>
Would you like to release the Moment (Mz) of a member [y/n]?:n
<<<<<<<<<<<<<<<<<<Enter in Restraint Data>>>>>>>>>>>>>>>>>>
Enter Restraint Code For Node1 {"1 1 1" is fixed}:1 1 1
Enter Restraint Code For Node2 {"1 1 1" is fixed}:0 0 0
Enter Restraint Code For Node3 {"1 1 1" is fixed}:1 1 1
<<<<<<<<<<<<<<<<<<Enter in apllied load data>>>>>>>>>>>>>>>>>>
Enter Applied load vector {R} For Node1 {"Fx Fy M"}:0 0 0
Enter Applied load vector {R} For Node2 {"Fx Fy M"}:0 -10 -1000
Enter Applied load vector {R} For Node3 {"Fx Fy M"}:0 0 0
<<<<<<<<<<<<<<<<<<FIXED END ACTIONS>>>>>>>>>>>>>>>>>>
Are there any member loads (ie Fixed end actions) [y/n]?:y
Enter members with applied member loads ie (# # #):1 2
Enter point loads at mid span for member_1 (Fx Fy) GLOBAL:0 0
Enter point loads at mid span for member_1 (fx fy) LOCAL:0 0
Enter Distributed load for member_1 (w) LOCAL:-0.2
Enter point loads at mid span for member_2 (Fx Fy) GLOBAL:0 -20
Enter point loads at mid span for member_2 (fx fy) LOCAL:0 0
Enter Distributed load for member_2 (w) LOCAL:0
............
RESULTS
............
Nodal Displacments {rf}
r2x = -0.019
r2y = -0.09408
theata_2 = -0.001826
............
Support Reactions {Rs}
R1x = 19
R1y = 10.33
M1 = 365.8
R3x = -19
R3y = 39.67
M3 = -875
............
Basic Member Forces {S}
Mi1 = 365.8
Mj1 = -332.8
F1 = -19
.
Mi2 = -667.2
Mj2 = -875
F2 = -39
.
............
 
Physics news on Phys.org
hi.. can i have a copy of your source codes?
cprelator@yahoo.com
would really appreciate your help.
 
elbarto, here's something to think about that might be helpful to you. Break up your code into logical sections, with the first section getting user input. After the user has entered all 20+ input values, present them all to the user in a numbered list, and ask him/her to confirm that they are correct. If so, continue as before. If not, ask the user which input to change by typing the number of the one to change. After each change, ask whether the user wants to change another value.

When the user is satisfied with the changes, control flow proceeds as before.
 
Hi mate, can i have a copy of your source codes?
m.s.ayubirad@gmail.com
would really appreciate your help.
 

Similar threads

  • · Replies 4 ·
Replies
4
Views
7K
  • · Replies 7 ·
Replies
7
Views
26K
  • · Replies 2 ·
Replies
2
Views
8K
  • · Replies 2 ·
Replies
2
Views
7K
  • · Replies 5 ·
Replies
5
Views
6K
Replies
1
Views
14K
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
9K
  • · Replies 12 ·
Replies
12
Views
2K
  • · Replies 4 ·
Replies
4
Views
8K