Unexpected fault in input

For a reason i can not understand MATLAB constantly stops when i try to use input command in a for repeat!!!!
What's wrong with it?! please help
Στιγμιότυπο οθόνης (6)_LI.jpg

3 commentaires

Walter Roberson
Walter Roberson le 18 Nov 2018
what is an example of what you input in response to the prompt ?
Walter Roberson
Walter Roberson le 18 Nov 2018
why does it think that line 267 to enter force is a comment ? There is no obvious % commenting it out . Does the line above it have a ... on it?
eden hazard
eden hazard le 18 Nov 2018
line 267 is a comment but you can not see the %
i want to put a [Fx,Fy,Fz] vector but it crashes in the next line before i even put the values in the input command.

Connectez-vous pour commenter.

Réponses (1)

Stephen23
Stephen23 le 17 Nov 2018
Modifié(e) : Stephen23 le 18 Nov 2018

1 vote

You did not enter any value, so FF is empty.
Any empty array cannot be expanded to fill the non-empty locations that you have specified with subscript indexing.

10 commentaires

eden hazard
eden hazard le 18 Nov 2018
it is instantly showing the fault before the input command...so i am not able to write the [Fx,Fy,Fz] i want.
Stephen23
Stephen23 le 18 Nov 2018
Modifié(e) : Stephen23 le 18 Nov 2018
"it is instantly showing the fault before the input command..."
Your error message shows that the error occurs on line 270, which is after the input command.
"so i am not able to write the [Fx,Fy,Fz] i want."
You have not explained what you want, so we have no idea if it is possible or not.
Note that defining FF on line 265 serves no purpose, because you redefine FF on line 269.
eden hazard
eden hazard le 18 Nov 2018
yes it shows that occurs on line 270,but as you can see i didnt have the chance to write in the input command.Also the value of FF is []. I dont know what happens but it is like it ''jumps'' the input command.But when i put a breakpoint and go step by step it works....Στιγμιότυπο οθόνης (7).png
Stephen23
Stephen23 le 18 Nov 2018
Modifié(e) : Stephen23 le 18 Nov 2018
Show us the complete output of this command:
which input -all
Please also upload your code by clicking the paperclip button.
eden hazard
eden hazard le 18 Nov 2018
Modifié(e) : eden hazard le 18 Nov 2018
built-in (C:\Program Files\MATLAB\R2015b\toolbox\matlab\lang\input)
choose crane,then 6065,then NO,then 2,the select a node and press enter
It is a bit complicated...is for FEM analysis
Stephen23
Stephen23 le 18 Nov 2018
Interesting. For me your code fails on line 372 or 380 with an indexing error. I don't get any problems with input.
eden hazard
eden hazard le 18 Nov 2018
so in line 270 are you able to write vectors in the input command ?!!!
Stephen23
Stephen23 le 18 Nov 2018
I think the code skipped those lines entirely. I never got that prompt. What magical combination of input values will get me there?
eden hazard
eden hazard le 18 Nov 2018
haha choose as following
1.crane
2.6065
3.NO
4.in ''how many loads'' write 2
5. then click on a node(point) in the plot and press enter
With those inputs, for me it fails on line 379
Nodes=R(2:33,1:4);
This is because the textscan() inputs almost nothing. It is
C = textscan(fileID,'%f %f %f %f %f %f %f',N,'CommentStyle','//');
however the first line with 7 input values in the file is line 166 so the textscan fails almost immediately.

Connectez-vous pour commenter.

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by