Cells detect and Cells numers in array

1 次查看(过去 30 天)
Hello,
I've got an array out of a scope simulation in simulink. In this array i've got the time in 1st column and the value of the signal in the 2nd. My max step size is 10sec. so the time data is from 0 to 1000 per 10 ( there is more values in time column but thats not the problem). I want to know what is the value of B1(the cell location as it is in excel) if A1=0. e.g. what is the value of the signal when time is 0 ? Then what is the value when the time is 60 sec and so on.
Thanks in advance !

采纳的回答

Star Strider
Star Strider 2021-8-3
M1 = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/701747/1.xlsx')
M1 = 65926×2
0 232.6044 0.0000 232.6044 0.0000 232.6044 0.0000 232.6044 0.0000 232.6044 0.0000 232.6044 0.0001 232.6044 0.0003 232.6044 0.0015 232.6044 0.0074 232.6044
time_desired = [0, 10, 60, 90, 120, 180]; % Define As Desired
interpolated_signal = interp1(M1(:,1), M1(:,2), time_desired.', 'linear')
interpolated_signal = 6×1
232.6044 232.6119 232.6492 232.6716 232.6940 232.7388
figure
plot(M1(:,1), M1(:,2),'-b')
hold on
plot(time_desired, interpolated_signal, 'rs')
hold off
grid
xlabel('time')
ylabel('signal')
xlim([0 200]) % Restrict Axis View To Sho9w Detail
Make necessary changes to get the result you want.
.
  7 个评论
Krasimir Terziev
Krasimir Terziev 2021-8-5
编辑:Krasimir Terziev 2021-8-5
That was what i looking for !
Thank you so much! I can't describe how greatful I am.
Wish u best of luck and stay save!
Star Strider
Star Strider 2021-8-5
Great!
As always, my pleasure!
You, too!
.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by