Change name of subplot into 2 for

2 ビュー (過去 30 日間)
John Doe
John Doe 2020 年 12 月 6 日
コメント済み: John Doe 2020 年 12 月 6 日
Hello everyone,
I may ask a silly question, need to change the name of 24 subplots.
I understood how to change the Objet1, but i don't know how to change the second part of the title, i'm stuck in the 2nd loop.
I want my title to be: Objet1/Task4 for exemple
Thanks everyone !
Here you have to code:
The main:
for mrkr=1:6
Tremor_functions.Timestamp(markers,mrkr,Fe)
for muscle=1:4
Tremor_functions.signal_processing(Debut,Fin,muscle,signal,Fe,mrkr,t);
The function that do the plots which is in "Tremor_functions.signal_processing" (you can jump at the bottom)
function signal_processing(Debut,Fin,muscle,signal,Fe,mrkr,t)
% Subplot temporal and frq
cellmuscle = {'Fl-Pr','Ex-Su','Bic','Tri'};
Muscle_Tache=strcat('Tache',num2str(mrkr),'Muscle',num2str(muscle));
Muscle_Tache=figure('Name',Muscle_Tache,'Position',[0 0 600 600]);
movegui(Muscle_Tache,'northwest');
subplot(2,1,1)
plot(t,EMG_filt,'r')
title(cellmuscle(muscle));
xlabel('Temps (s)')
ylabel('EMG (mV)')
subplot(2,1,2)
plot(f_DSP,EMG_filt_DSP,'b')
xlim([0 50])
title(cellmuscle(muscle));
%title('Muscle/Task')
xlabel('Fréquence (Hz)')
ylabel('DSP (mv2/Hz)')
Muscle_Task=strcat('Muscle',num2str(mrkr),'Task',num2str(muscle),'.bmp');
saveas(Muscle_Tache,Muscle_Task);
  2 件のコメント
Walter Roberson
Walter Roberson 2020 年 12 月 6 日
Could you confirm that you no longer want the title() to include, for example, 'Ex-Su', and would want that to be (for example) 'Objet3/Task2' instead ?
John Doe
John Doe 2020 年 12 月 6 日
Hello Walter,
No objet 3 / task 2 was an exemple,
I do need, Fl-Pr','Ex-Su','Bic','Tri'
And i need to change with the task
I need it to do:
Fl-Pr / Task 1
Ex-Su / Task 1
Bic / Task 1
Tri / Task 1
Fl-Pr / Task 2
... to
Tri / Task 6
Displayed on the figure subplot title

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

採用された回答

Setsuna Yuuki.
Setsuna Yuuki. 2020 年 12 月 6 日
編集済み: Setsuna Yuuki. 2020 年 12 月 6 日
You can try change:
Muscle_Task=strcat('Muscle',num2str(mrkr),'Task',num2str(muscle),'.bmp');
to:
Muscle_Task=['Muscle' num2str(mrkr) 'Task' num2str(muscle)]
saveas(Muscle_Tache,Muscle_Task,'bmp');
  3 件のコメント
Setsuna Yuuki.
Setsuna Yuuki. 2020 年 12 月 6 日
i understand, try this:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
cellmuscle = ["Fl-Pr","Ex-Su","Bic","Tri"];
task = mrkr*ones(1,4);
nombre = [cellmuscle(muscle) '/Task' num2str(task(muscle))]
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Muscle_Tache=strcat('Tache',num2str(mrkr),'Muscle',num2str(muscle));
Muscle_Tache=figure('Name',Muscle_Tache,'Position',[0 0 600 600]);
movegui(Muscle_Tache,'northwest');
subplot(2,1,1)
plot(t,EMG_filt,'r')
title(cellmuscle(muscle));
xlabel('Temps (s)')
ylabel('EMG (mV)')
subplot(2,1,2)
plot(f_DSP,EMG_filt_DSP,'b')
xlim([0 50])
title(nombre);
xlabel('Fréquence (Hz)')
ylabel('DSP (mv2/Hz)')
John Doe
John Doe 2020 年 12 月 6 日
Yeah, super Bastian, genius !!
Thanks a lot !

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSubplots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by