How to write loops within loops for a function.
5 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Angel Ani
am 30 Mai 2021
Kommentiert: Angel Ani
am 28 Jun. 2021
if true
Given,
Ans1 = 0;
Vs = 8: 0.1: 7; % = I want Vs as 8, 7.9, 7.8,...,7.0
For Vs=Vs-1. %(from 8 to 7) do,
For Z=1:6 %(1,2,...,6)
M= -Z*x + Vs * x
End For
syms J Ans2 = symsum((Vs - Z)/J ,J,0,4) %is a function
If Ans2 >= Ans1 Vs = Vs - 1 % Next Vs is 7.9 Ans1 = Ans2 End if
Vs=Vs-0.1 End For
end
0 Kommentare
Akzeptierte Antwort
KALYAN ACHARJYA
am 30 Mai 2021
Bearbeitet: KALYAN ACHARJYA
am 30 Mai 2021
Vs = 8:-0.1:7
o/p:
8 7.9 7.8 7.7 7.6 7.5 7.4 7.3 7.2 7.1 7
Hoe you can do the later part.
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!