How ro divide a scalar by a excel data and plot the result?

4 ビュー (過去 30 日間)
Vishnuvardhan Naidu Tanga
Vishnuvardhan Naidu Tanga 2022 年 1 月 18 日
Hello everyone,
I am trying to plot a excel data, where the data is divided by a single scalar value. But when I am trying to plot the data I am not getting the desired result. The clear explaniation is: 51 a scalar value should be divided by the data in coloum 4. So basically 51/data(:,4). I am attaching the data and the code. Please kindly help me. Thanks in advance.
Z = readtable('centerlinevel.xlsx') ;
data = table2array(Z) ;
N = size(data,2);
Nsp = N/2;
X= 51/data(:,4);
plot(data(:,1), data(:,2), '*');
hold on
plot(data(:,3), X, 'linewidth', 2);
hold off

採用された回答

VBBV
VBBV 2022 年 1 月 18 日
X= 51./data(:,4);
Use the element wise division operator

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeData Import from MATLAB についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by