Results 1 to 1 of 1

Math Help - Matlab

  1. #1
    Newbie
    Joined
    Dec 2009
    Posts
    1

    Question 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;
    load reentry.txt;
    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!
    Last edited by CaptainBlack; December 6th 2009 at 09:48 PM.
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Matlab Help
    Posted in the Math Software Forum
    Replies: 1
    Last Post: April 17th 2010, 09:13 AM
  2. Matlab
    Posted in the Math Software Forum
    Replies: 0
    Last Post: March 3rd 2010, 02:18 PM
  3. i need help in matlab
    Posted in the Math Software Forum
    Replies: 0
    Last Post: March 2nd 2010, 08:49 PM
  4. Matlab help
    Posted in the Math Software Forum
    Replies: 1
    Last Post: April 21st 2009, 05:42 AM
  5. MATLAB
    Posted in the Math Software Forum
    Replies: 4
    Last Post: September 25th 2008, 02:47 PM

Search Tags


/mathhelpforum @mathhelpforum