plot/stackedplot excel matlab

2 vues (au cours des 30 derniers jours)
Salwa Ben Mbarek
Salwa Ben Mbarek le 22 Avr 2021
Hello,
Can anyone tell me how to plot excel tabel in matlab? I've try plot/ stackedplot but it does not work. Can you please help me?
Here's the code:
clc;
clear all;
T = readtable('file.xlsx');
A = readtable('file.xlsx','Range','D11:D49');
B= readtable('file','Range','I11:I49');
A_plot=A(:,1);
B_plot= B(:,1);
figure
plot(A_plot,B_plot)
stackedplot(A,B)

Réponse acceptée

Scott MacKenzie
Scott MacKenzie le 22 Avr 2021
Modifié(e) : Scott MacKenzie le 22 Avr 2021
Try changing
A_plot = A(:,1);
B_plot = B(:,1);
to
A_plot = table2array(A(:,1));
B_plot = table2array(B(:,1));
  1 commentaire
Salwa Ben Mbarek
Salwa Ben Mbarek le 22 Avr 2021
That works, thank you !

Connectez-vous pour commenter.

Plus de réponses (0)

Tags

Produits

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by