Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

What do these codes mean?

$
0
0
What does this mean?: Lmax=B(1,4);%Lmax is equal to the maximum value in the vector

Also, if my inputs are 100,300,250, and 50, how will the value for Lmax, Lmin, La, and Lb turn out to be?
---------------------------------------------------------------------------------------------------------------
here are the inputs

L0=50,100,300
L1=600,300,100
L2=400,250,150
L3=500,50,200

fprintf('Enter Link Length\n')
L0=input('Fixed link:');%input L0
L1=input('Shorter Side Link:');%input L1
L2=input('Coupler:');%input L2
L3=input('Longer Side link:');%input L3

A=[L0,L1,L2,L3];% arrange numbers into vector
B=sort(A);%sort numbers from min to max

Lmax=B(1,4);%Lmax is equal to the maximum value in the vector
Lmin=B(1,1);%Lmin is equal to the minimum value in the vector
La=B(1,2);%La is equal to one of the rests.
Lb=B(1,3);%Lb is equal to one of the rests.

thank you

Viewing all articles
Browse latest Browse all 19628

Trending Articles