How to load excel columns under same variable file
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Yellow Canary
le 12 Sep 2015
Commenté : the cyclist
le 12 Sep 2015
I have an excel file it has 2 columns of data. When I import this file to Matlab, each column shown as a different file. (ex: VarName1 and VarName2) I want to show them under the same file. I want to plot them to Bar3 plot. When they are separate, I can't show them on the same plot. I want to plot a graph like this example http://www.mathworks.com/help/matlab/ref/bar3.html
0 commentaires
Réponse acceptée
the cyclist
le 12 Sep 2015
One possible solution is to just concatenate the two variables into one array:
VarName1 = rand(7,1);
VarName2 = rand(7,1);
figure
bar3([Varname1; Varname2])
2 commentaires
the cyclist
le 12 Sep 2015
Clicking "Accept this Answer" is the best form of thanks (and may help guide future users with a similar question).
Plus de réponses (1)
the cyclist
le 12 Sep 2015
If you use the Import Data tool (located in the Command Window), you can specify that you want to import into one variable, rather than separate columns. You can also have it generate code for you to do the import.
0 commentaires
Voir également
Catégories
En savoir plus sur Data Import from MATLAB dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!