How can I find the largest number
Hi,
I have 3 numbers and I have to find the biggest one, what is the best way?
This is the code:
T=200
if isempty(counter) || counter >= T
counter=0;
d1=0.1
d2=0.2
d3=0.6
else counter=counter+1
if counter>0
if d1=max([d1,d2,d3)]
…
elseif d2=max([d1,d2,d3)]
…
elseif d3=max([d1,d2,d3)]
…
end
end
end
But this code doesn’t work, thank youHi,
I have 3 numbers and I have to find the biggest one, what is the best way?
This is the code:
T=200
if isempty(counter) || counter >= T
counter=0;
d1=0.1
d2=0.2
d3=0.6
else counter=counter+1
if counter>0
if d1=max([d1,d2,d3)]
…
elseif d2=max([d1,d2,d3)]
…
elseif d3=max([d1,d2,d3)]
…
end
end
end
But this code doesn’t work, thank you Hi,
I have 3 numbers and I have to find the biggest one, what is the best way?
This is the code:
T=200
if isempty(counter) || counter >= T
counter=0;
d1=0.1
d2=0.2
d3=0.6
else counter=counter+1
if counter>0
if d1=max([d1,d2,d3)]
…
elseif d2=max([d1,d2,d3)]
…
elseif d3=max([d1,d2,d3)]
…
end
end
end
But this code doesn’t work, thank you largest number, counter MATLAB Answers — New Questions