how do I create array with numbers and characters to then put into a table?
I’m trying to create a table from an array for which I need empty certain coluns to display blank (or NA). I tried this….
switch n
case 1
sumT =array2table({k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload},’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
case 2
sumT =array2table({k,ZIA,’_’,f1,’_’,’_’,R2,Irms,Pload},’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
case 3
sumT =array2table([k,ZIA,’_’,’_’,f2,’_’,R2,Irms,Pload],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
case 4
sumT =array2table([k,ZIA,’_’,’_’,’_’,f2pk,R2,Irms,Pload],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
otherwise
disp(‘oops’)
end
I’ve tried :
array2table({k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload}…
array2table([k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload]…
array2table([{k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload}]….
etc, but none of these combinations seem to work.
sumT =array2table([k,ZIA,f1pk,’ ‘,’ ‘,’ ‘,R2,Irms,Pload],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
results in :
this one,
sumT =array2table([{k,ZIA,f1pk,’ ‘,’ ‘,’ ‘,R2,Irms,Pload}],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
generates this output.
How do I display the contents of the "containers}?
how can I include doubles and blanks in the same array and then display them as such in a table?
Thank you.I’m trying to create a table from an array for which I need empty certain coluns to display blank (or NA). I tried this….
switch n
case 1
sumT =array2table({k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload},’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
case 2
sumT =array2table({k,ZIA,’_’,f1,’_’,’_’,R2,Irms,Pload},’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
case 3
sumT =array2table([k,ZIA,’_’,’_’,f2,’_’,R2,Irms,Pload],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
case 4
sumT =array2table([k,ZIA,’_’,’_’,’_’,f2pk,R2,Irms,Pload],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
otherwise
disp(‘oops’)
end
I’ve tried :
array2table({k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload}…
array2table([k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload]…
array2table([{k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload}]….
etc, but none of these combinations seem to work.
sumT =array2table([k,ZIA,f1pk,’ ‘,’ ‘,’ ‘,R2,Irms,Pload],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
results in :
this one,
sumT =array2table([{k,ZIA,f1pk,’ ‘,’ ‘,’ ‘,R2,Irms,Pload}],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
generates this output.
How do I display the contents of the "containers}?
how can I include doubles and blanks in the same array and then display them as such in a table?
Thank you. I’m trying to create a table from an array for which I need empty certain coluns to display blank (or NA). I tried this….
switch n
case 1
sumT =array2table({k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload},’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
case 2
sumT =array2table({k,ZIA,’_’,f1,’_’,’_’,R2,Irms,Pload},’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
case 3
sumT =array2table([k,ZIA,’_’,’_’,f2,’_’,R2,Irms,Pload],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
case 4
sumT =array2table([k,ZIA,’_’,’_’,’_’,f2pk,R2,Irms,Pload],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
otherwise
disp(‘oops’)
end
I’ve tried :
array2table({k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload}…
array2table([k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload]…
array2table([{k,ZIA,f1pk,’_’,’_’,’_’,R2,Irms,Pload}]….
etc, but none of these combinations seem to work.
sumT =array2table([k,ZIA,f1pk,’ ‘,’ ‘,’ ‘,R2,Irms,Pload],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
results in :
this one,
sumT =array2table([{k,ZIA,f1pk,’ ‘,’ ‘,’ ‘,R2,Irms,Pload}],’VariableNames’,{‘k’,’ ZIA’, ‘f1pk’,’fres1′,’fres2′,’f2pk’,’R2′,’Irms’,’Pload’})
generates this output.
How do I display the contents of the "containers}?
how can I include doubles and blanks in the same array and then display them as such in a table?
Thank you. cell arrays, tables, mixed variables MATLAB Answers — New Questions