Help to plot a graph using the data file

59 ビュー (過去 30 日間)
Ruthra
Ruthra 2025 年 12 月 5 日
コメント済み: Star Strider 2026 年 1 月 10 日 17:14
I have the data filefor the velocity, for which i need aplot a graph.

回答 (1 件)

Star Strider
Star Strider 2025 年 12 月 5 日
Perhaps something like this --
writematrix([0:10; sin(2*pi*(0:10)/20)].','Your_Data.csv') % Create File
Data = readmatrix('Your_Data.csv') % Read File
Data = 11×2
0 0 1.0000 0.3090 2.0000 0.5878 3.0000 0.8090 4.0000 0.9511 5.0000 1.0000 6.0000 0.9511 7.0000 0.8090 8.0000 0.5878 9.0000 0.3090 10.0000 0.0000
<mw-icon class=""></mw-icon>
<mw-icon class=""></mw-icon>
Time = Data(:,1);
Velocity = Data(:,2);
figure
plot(Time, Velocity)
grid
axis('padded')
xlabel('Time')
ylabel('Veolcity')
title('Data')
.
  29 件のコメント
Ruthra
Ruthra 2026 年 1 月 10 日 16:43
Star Strider
Star Strider 2026 年 1 月 10 日 17:14
You have a script named 'grid.m' that is overshadowing with the MATLAB grid function.
You need to rename your 'grid.m' to something that is different from any of the MATLAB built-in functions.
(I assume the files are being read, so 'u{:}' and 'v{:}' have data.)

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeText Data Preparation についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by