How do I stop a code from continuing ifelse statements?
10 views (last 30 days)
I'm creating a script that converts phasor to complex numbers and then back again once I'm done converting. However if I only have one phasor to convert the script runs until the very end. How do I end the whole script if it satisfies what the user wants to do with it. For instance, if a==1 I want it to do the conversion then finish.
Mag1=input('What is the magnitude in the frequency domain? ');
Angle1=input('What is the angle in the frequency domain? ');
disp('Enter 1 for yes, 0 for no')
a=input('Are you done converting from phasor to complex?' );
Mag2=input('What is the second magnitude?' )
Angle2=input('What is the second angle? ' )
b=input('Are you done coverting now? ');
c=input('Would you like to add the two complex numbers together? ' );
Thank you for any suggestions you may have.