matlab_learner <cibeji@gmail.com> wrote in message <b1e6a269-1d3c-4f48-9d72-529df2eb2082@b4g2000pra.googlegroups.com>...
> i need to make a graph on matlab of the material against the property.
>
> here are my data:
>
> eglass=1.38;
> sglass= 1.85;
> graphiteHiE = 1.1;
> graphiteHiTS= 1.3;
> Boron=1.1;
> Silica = 2.65;
> Tungsten= 0.22;
> Beryllium = 0.71;
> Kevlar49=1.87;
>
> Traditional materials
> steel=.043 - .27;
> Al alloys= .052 - .23;
> Glass=.028 - .84;
> Tungs2=057 - .21;
> Beryllium2=.38;
>
>
> You can see that the traditional materials do not allow u to have the
> same data type.
>
> i am plotting the material against the property (the numbers)
>
> what is the right plot command to do it (already tried plot and it
> didn't work..each material has to stand out - will Excel be better?)
> and how best to represent the traditional materials.
>
> thank u.
Analyze this code, I hope that it will be useful:
M = [
1.38%eglass
1.85%sglass
1.1%graphiteHiE
1.3%graphiteHiTS
1.1%Boron
2.65%Silica
0.22%Tungsten
0.71%Beryllium
1.87%Kevlar49
];
names = {
'eglass'
'sglass'
'graphiteHiE'
'graphiteHiTS'
'Boron'
'Silica'
'Tungsten'
'Beryllium'
'Kevlar49'
};
pie(M)
legend(names)
%Traditional materials
steel=[.043 .27];
Al_alloys= [.052 .23];
Glass=[.028 .84];
Tungs2=[.057 .21];
Beryllium2=.38;
figure
bar(1,steel(2),'BaseValue',steel(1))
hold on
bar(2,Al_alloys(2),'r','BaseValue',Al_alloys(1))
bar(3,Glass(2),'g','BaseValue',Glass(1))
bar(4,Tungs2(2),'k','BaseValue',Tungs2(1))
legend('steel','Al alloys','Glass','Tungs2')
figure
m = [ .043 .27
.052 .23
.028 .84
.057 .21];
errorbar(1:4,mean(m,2),m(:,2)-mean(m,2),'LineStyle','none')
set(gca,'xtick',1:4,'xticklabel',{'steel','Al alloys','Glass','Tungs2'})
|