Thread Subject: for loop help
|
Could someone show a basic for loop that could produce the below results?
L1.slope = [-59.3968 -56.9777 -54.7794 -51.587 -48.3138 -46.1093];
L1.int = [571.9502 566.8451 560.12 550.4008 539.3366 530.5057];
% LW is computed with above slope and intercept given measured windspeed.
L1.a = L1.slope(1:1)*v+L1.int(1:1);
L1.b = L1.slope(2:2)*v+L1.int(2:2);
L1.c = L1.slope(3:3)*v+L1.int(3:3);
L1.d = L1.slope(4:4)*v+L1.int(4:4);
L1.e = L1.slope(5:5)*v+L1.int(5:5);
L1.f = L1.slope(6:6)*v+L1.int(6:6);
LW = [L1.a L1.b L1.c L1.d L1.e L1.f];
|
|
AMK <kennaster@gmail.com> wrote in message <1517414598.370865.1268421331497.JavaMail.root@gallium.mathforum.org>...
> Could someone show a basic for loop that could produce the below results?
>
> L1.slope = [-59.3968 -56.9777 -54.7794 -51.587 -48.3138 -46.1093];
> L1.int = [571.9502 566.8451 560.12 550.4008 539.3366 530.5057];
>
> % LW is computed with above slope and intercept given measured windspeed.
> L1.a = L1.slope(1:1)*v+L1.int(1:1);
> L1.b = L1.slope(2:2)*v+L1.int(2:2);
> L1.c = L1.slope(3:3)*v+L1.int(3:3);
> L1.d = L1.slope(4:4)*v+L1.int(4:4);
> L1.e = L1.slope(5:5)*v+L1.int(5:5);
> L1.f = L1.slope(6:6)*v+L1.int(6:6);
>
> LW = [L1.a L1.b L1.c L1.d L1.e L1.f];
If you just need LW:
>>LW = L1.slope*v+L1.int;
|
|
AMK <kennaster@gmail.com> wrote in message <1517414598.370865.1268421331497.JavaMail.root@gallium.mathforum.org>...
> Could someone show a basic for loop that could produce the below results?
>
> L1.slope = [-59.3968 -56.9777 -54.7794 -51.587 -48.3138 -46.1093];
> L1.int = [571.9502 566.8451 560.12 550.4008 539.3366 530.5057];
>
> % LW is computed with above slope and intercept given measured windspeed.
> L1.a = L1.slope(1:1)*v+L1.int(1:1);
> L1.b = L1.slope(2:2)*v+L1.int(2:2);
> L1.c = L1.slope(3:3)*v+L1.int(3:3);
> L1.d = L1.slope(4:4)*v+L1.int(4:4);
> L1.e = L1.slope(5:5)*v+L1.int(5:5);
> L1.f = L1.slope(6:6)*v+L1.int(6:6);
>
> LW = [L1.a L1.b L1.c L1.d L1.e L1.f];
If you just need LW:
>>LW = L1.slope*v+L1.int;
|
Tags for this Thread
Add a New Tag:
Separated by commas
Ex.: root locus, bode
What are tags?
A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.
Anyone can tag a thread. Tags are public and visible to everyone.
Feed for this Thread
Contact us at files@mathworks.com