Plotting mutiple measurement Data with counter

Hello together,
i would like to plot my measurements data 66 signals over time in one plot.
However i wrote a counter that i dont have to deal with 66 signals.
How can i plot now all this data in one plot using my counter?
My Script
% 28 or 33 C with 2 sensors each
for iC = 1:numOfC
for iTempOfC = 1:2
signalNameCTemp = sprintf("CC_%02i_Temperatur_%01i", iC, iTempOfC);
idxTemp = (iC - 1) * 2 + iTempOfC; %sub2ind([3,2],2,2)
plot (m.t, all signals of the 66 sensors)
So far I only get 1 signal in my plot.
Thank you guys.

댓글 수: 3

Ganesh
Ganesh 2024년 6월 14일
If you are plotting them one by one, ensure you have written "hold on" after your first plot, other signals get plotted on the same plot.
Ganesh
Ganesh 2024년 6월 14일
"all signals of the 66 sensors"
Does it mean you are storing all of the signals in one variable? I also wonder what the for loop is doing.
Is it possible for us to see what the data looks like? And the full implementation of your code?
Si
Si 2024년 6월 14일
편집: Si 2024년 6월 14일
To carify my statement from before:
all the signals are in my measurement data with i load into matlab.
filename = '.....'
m = load (filename)
example for temperature signals without my counter:
C_01__Temperatur_01
C_01__Temperatur_02
C_02__Temperatur_01
.
.
.
C_33_Temperatur_02
I could solve it, if i plot now all this signals, but i want to make a more intelligent solution.
plot(m.t,m.C_01__Temperatur_01)
.
.
.
plot(m.t,m.C_33__Temperatur_02)
Greetings

댓글을 달려면 로그인하십시오.

답변 (1개)

Si
Si 2024년 6월 14일
이동: Angelo Yeo 2024년 6월 14일

0 개 추천

Hello,
i found a solution:
%%
fig1 = figure;
hold on
for iC = 1:numOfC % 28 oder 33 C
for iTempOfC = 1:2
signalNameCTemp = sprintf("C_%02i_Temperatur_%01i", iC, iTempOfC);
plot(m.t,m.(signalNameCTemp));
end
end
hold off
%%
Now i get all signals in my graph.

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품

릴리스

R2021b

질문:

Si
2024년 6월 14일

이동:

2024년 6월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by