Use flowchart for Matlab
Ältere Kommentare anzeigen

I am trying to write a script named as tstdigit.m using this flow chart
so far all I have is:
>> a = input('please enter a: ');
please enter a: if a > 0
if a > 0
1 Kommentar
KALYAN ACHARJYA
am 7 Nov. 2018
Antworten (2)
KALYAN ACHARJYA
am 7 Nov. 2018
Bearbeitet: KALYAN ACHARJYA
am 7 Nov. 2018
% Try to learn, as you have shared, what you have done, that's why I have posted the answer.
% try to learn, learn by doing
a=input('Input a: Enter the number ');
if a<0
disp('Nagative Value');
else
if a<10
disp('Single Digit');
else
disp('Out of range');
end
end
8 Kommentare
KALYAN ACHARJYA
am 7 Nov. 2018
Bearbeitet: KALYAN ACHARJYA
am 7 Nov. 2018
Above code is according to the flow of the diagram, another way you can implement the same logic with single if else statement
a=input('Input a: Enter the number ');
if a<0
disp('Nagative Value');
elseif a<10
disp('Single Digit');
else
disp('Out of range');
end
KALYAN ACHARJYA
am 7 Nov. 2018
Bearbeitet: KALYAN ACHARJYA
am 7 Nov. 2018
And for a=10, the logic is not provided in the flowchart.
SP
am 7 Nov. 2018
KALYAN ACHARJYA
am 7 Nov. 2018
no, show me the results
Shamsher Ansari
am 21 Apr. 2020
Kalyan sir, Thank you
but how I can Become like you a Matlab Programmer
please suggest me
KALYAN ACHARJYA
am 21 Apr. 2020
Bearbeitet: KALYAN ACHARJYA
am 21 Apr. 2020
Oh, I am also learner here, Just practice..repeat ..practice
See the answers provided by members and start here
Good Wishes!
Shamsher Ansari
am 21 Apr. 2020
Bearbeitet: Shamsher Ansari
am 21 Apr. 2020
Thank you sir,
Please sir, reply to my question on the above problem with small modification" .....what change will be in the program,,,,please sir...........(at "input a" suppose there is some calculation and i want to repeat it to some extent to achieve a perticular result)

KALYAN ACHARJYA
am 21 Apr. 2020
while condition
% Previous code
end
Till the condition not met it iterative continlusly, please ensure that once condition must be met, otherwise it will run infinitely.
Aatif Ameer
am 26 Dez. 2020
0 Stimmen
Can anyone solve the problem, i am attaching it with the ques. please convert flow chat into matlab code.
1 Kommentar
KALYAN ACHARJYA
am 26 Dez. 2020
Please read here
Kategorien
Mehr zu Aerospace Applications finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!