From: Sourav on
i have a problem
suppose i have
a=.3
b=.4
c=2

now i need to sort out the highest value in the form of a,b or c,

i am very new to programing(matlab)
every time i used "sort[]" function it gives the numerical output, but I need the character,

can somebody help me to do the job
From: Walter Roberson on
Sourav wrote:
> i have a problem
> suppose i have a=.3
> b=.4
> c=2
>
> now i need to sort out the highest value in the form of a,b or c,
> i am very new to programing(matlab)
> every time i used "sort[]" function it gives the numerical output, but I
> need the character,
> can somebody help me to do the job


Exact results not guaranteed, as it is after midnight here.


function varname = sort3name(v1, v2, v3)
varname = inputname( 2*(v1 <= v2) + v2 <= v3 + (v1>v2 & v2>v3) );
end

highestletter = sort3name(a,b,c);
From: ImageAnalyst on
Sourav
Not sure what you mean by "sort out" (in my part of the world that
colloquialism means to "understand"), but if you want to find the
highest value you could use this:
highestValue = max([a b c]);
From: ImageAnalyst on
Maybe you mean this:

clc;
workspace;
a=.3
b=.4
c=2
[highestValue indexes] = max([a b c])
inCharacterForm = num2str(highestValue)
From: Sourav on
thank you thats what i have meant,, thanx a lot for your help