Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how can i debug below error in matlab

Status
Not open for further replies.

krishnagupta023

Newbie level 1
Joined
Feb 19, 2013
Messages
0
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,280
Activity points
1,280
i am trying to run matlab code which is as below

%------------modulation for n=1 at antenna 0------------------
if (real(sn)>= 0 )
tet11=0;
else (real(sn)<= 0 );
tet11=1;
end

but while running it's showing error saying
" <= produces a value that might be unused "

can anyone help me to debug this error please...
 

I copied your MATLAB code and tried to run it and MATLAB says that 'sn' is undefined, please upload code completely.
 

You have missing if after the else word
 

By the way;
You don't exculude if equals to 0 case, i mean what you want to be happen in that case.
You use both if "<=0" and ">=0", if it is equals 0, which one should be happen? Currently first if statement will be action and the other one discarded.
Take care that point.
 

as emresel said you should correct your digit after <= and >= . anyway it is better to use < and > instead <= and >=. for example use x<1 instead use x<=0.
 

For this case of yours, the syntax is not correct as you can not use a condition after 'else' statement. So either use 'else' alone (which really would solve your ambiguous real(sn)==0 case ) or use 'elseif' statement with appropriate correction to the condition overlap.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top