Azzera filtri
Azzera filtri

Hello, I need a help , In Matlab how can I plot a graph from an excel data in real time ?

3 visualizzazioni (ultimi 30 giorni)
data = xlsread('data.xls');
column_data = data(:, 1); % replace 1 with the column number you want to plot
figure;
ax = axes;
plot(ax, column_data);
xlim(ax, [0, length(column_data)]);
xlabel(ax, 'Time');
ylabel(ax, 'Data');
while true
% Read the latest data from the Excel file
data = xlsread('data.xls');
% Extract the latest data that you want to plot
new_data = data(:, 1); % replace1 with the column number you want to plot
% Append the new data to the existing data
column_data = [column_data; new_data];
% Update the plot with the new data
plot(ax, column_data);
% Pause for a short amount of time to allow new data to be generated
pause(0.01);
end

Risposte (0)

Categorie

Scopri di più su 2-D and 3-D Plots in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by