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 !
0 个评论
采纳的回答
Star Strider
2021-8-3
M1 = readmatrix('https://www.mathworks.com/matlabcentral/answers/uploaded_files/701747/1.xlsx')
time_desired = [0, 10, 60, 90, 120, 180]; % Define As Desired
interpolated_signal = interp1(M1(:,1), M1(:,2), time_desired.', 'linear')
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!