for loop - Matlab '&&' error -


i need code. cant figure out im doing wrong. here criterias try code (http://imgur.com/a/iu3bl) , data file ( https://drive.google.com/file/d/0byyia_19kck4sxjmt2q2zhjhlvu/view?usp=sharing ) code solve it. code 'ns' , want "regime" data respect table. thx try help

data = xlsread('data.xls'); pp=data(:,2); tp=data(:,4); bp=data(:,6); region={ };  i=1:length(data)  if pp(i)>=52 && 35>=tp(i); region{i}='nf'; elseif 40<=pp(i) & pp(i)<52 & (tp(i)<=20); region{i}='ns'; elseif (40>pp(i)) && (bp(i)>=45) && tp(i)<=20; region{i}='ss'; elseif (pp(i)<=20) && (45<=bp(i)) && (tp(i)<=40); region{i}='ss'; elseif (pp(i)<=20) && (40<=tp(i) && tp(i)<=52) ; region{i}='ts'; elseif (pp(i) <=32) && (tp(i)>=52); region{i}='nf'; else  region{i}='un'; end  end 

your p_plunge between 40 & 52. makes perfect sense fall under ns.

perhaps might want use column 1 data?

also use && instead of &.

good luck!


Comments

Popular posts from this blog

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -

c# - Update a combobox from a presenter (MVP) -

How to understand 2 main() functions after using uftrace to profile the C++ program? -