Post Reply 
Help, I have a syntax error
10-01-2015, 06:41 PM
Post: #3
RE: Help, I have a syntax error
Han thanks, but I'm lost in space.

This is my original Matlab code, but I have some problems with
the "elseif"
Please can you help me with this?

Cheers

Jan

Code:

function region_pT = region_pT(p, T)
if T > 1073.15 && p < 10 && T < 2273.15 && p > 0.000611 
    region_pT = 5;
elseif T <= 1073.15 && T > 273.15 && p <= 100 && p > 0.000611 
    if T > 623.15 
        if p > B23p_T(T) 
            region_pT = 3;
            if T < 647.096 
                ps = p4_T(T);
                if abs(p - ps) < 0.00001
                    region_pT = 4;
                end
            end
        else
            region_pT = 2;
        end
    else
        ps = p4_T(T);
        if abs(p - ps) < 0.00001 
            region_pT = 4;
        elseif p > ps
            region_pT = 1;
        else
            region_pT = 2;
        end
    end
else
    region_pT = 0; %**Error, Outside valid area
end
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Help, I have a syntax error - Powersoft - 10-01-2015, 06:20 PM
RE: Help, I have a syntax error - Han - 10-01-2015, 06:25 PM
RE: Help, I have a syntax error - Powersoft - 10-01-2015 06:41 PM
RE: Help, I have a syntax error - Han - 10-01-2015, 06:58 PM



User(s) browsing this thread: 1 Guest(s)