# Math Help - Matlab

1. ## Matlab

Hi, I have to do this programming assignment for tomorrow. I have already completed until letter e. But I am stuck in f since I do not understand how to do it. I tried many things, but none of them worked.
I did this:

Code:
clear;
clc;
global kr uc q b v alpha;
kr=reentry(1,1);
uc=reentry(1,2);
q=reentry(1,3);
b=reentry(1,4);
v=input('Enter velocity in miles per hour: ');
alpha=input('Enter angle in degrees: ');
Tsini=1000;
Ts=fzero('mcb413pa5fun',Tsini);
again=1;
while (Ts>1001 || Ts<999 )
if Ts<999
fprintf('\nReentry of temperature %2.2f ', Ts)
fprintf('is too low.\n\n')
fprintf('You should increase your velocity or your angle.\n')
elseif Ts>1001
fprintf('\nReentry of temperature %2.2f ', Ts)
fprintf('is too high.\n\n')
fprintf('You should decrease your velocity or your angle.\n')
end
v=input('Enter velocity in miles per hour: ');
alpha=input('Enter angle in degrees: ');
Tsini=1000;
Ts=fzero('mcb413pa5fun',Tsini);

end;

fprintf('\n\nReentry of temperature %2.2f is safe.\n',Ts)
and I am supposed to :
f. ) Requests whether the user wants to try additional values of alpha and v. If "yes", the program continues to request new alpha and v values until another successful reentry combination is determined. If "no", the program prints a sentence to a file called results.txt, indicating the successful values of alpha and v.

i tried adding another condition in the while loop... another variable.. But it won't work!

g.) Plots a graph of safe combinations of reentry velocity v vs. alpha, which yield a reentry temperatureof Ts = 1000 k. Plot the locations of these combinations as a solid black line using increments of one degree from alpha = 30 to 60 degrees. On the same graph, show as a red circle the location of the successful reentry values of v vs. alpha determined in part f .
I haven't tried this. How am supposed to find values for v and alpha and plot them? I know how to plot, I just need to know what valued I can use!