How can i make a multiple variable input for creating an array ?

Asked by Carlos Jimenez Sosa on 13 Aug 2012
Latest activity Commented on by Carlos Jimenez Sosa on 13 Aug 2012

Hello dear Matlab users,

Currently i am working on a code for mechanical mechanisms, i want to let the user input the amount of bars and pairs that the system has so i can let them know the characteristical polynomial of that particular mechanism. I know how to do it and i designed the pseudocode but i have a problem :

I am asking the user to input the linkage of the bars, for example, bar 1 is linked with bar 3, so i need to create an array like [1,3]

I did it with something like this :

%union = inputdlg({'row''column'},'Type the unions');

But it returns me something like this :

%union = '1' '3'

How can i get that numbers in an array like [1,3] or call

a = 1 , b = 3

with just one input so i can fill a zeros matrix with ones in that position?

Thanks!

0 Comments

Carlos Jimenez Sosa

Products

No products are associated with this question.

1 Answer

Answer by Walter Roberson on 13 Aug 2012
Accepted answer
TheArray = str2double(union);

1 Comment

Carlos Jimenez Sosa on 13 Aug 2012

Thank you so much for your fast reply!

Walter Roberson

Contact us