Info

이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.

How to plot plot from differnet location in a single figure?

조회 수: 1 (최근 30일)
SHARAD KUMAR UPADHYAY
SHARAD KUMAR UPADHYAY 2019년 6월 25일
마감: MATLAB Answer Bot 2021년 8월 20일
%% I have differnt date from differnt folder in differnt location, as D:/pendrive/coulomb_drag/Temperature/matlab_program/drag_Copy_dd/taudrag.mat having data T(1*25) %%and output (3*25*) and in another folder in another location D:/pendrive/coulomb_drag/Temperature/matlab_program/drag_Copy_nn/taudrag.mat again have T(1*25) %%and output (2*25). I wants to plot one figure where i wants figure with respect to T(1*25) and output(5*25).
%% please tell me how could i do this.

답변 (1개)

TADA
TADA 2019년 6월 25일
If i understand your question corectly, and you have several .mat files each one with a varriable T and a varriable output,
you can load them like that:
data(1) = load('D:/pendrive/coulomb_drag/Temperature/matlab_program/drag_Copy_dd/taudrag.mat');
data(2) = load('D:/pendrive/coulomb_drag/Temperature/matlab_program/drag_Copy_nn/taudrag.mat');
that syntax returns a struct with fields for each varriable saved in that .mat file.
that would only work if you have the exact same varriable names saved in both files, otherwise you can simply load them into two different varriables
for i = 1:numel(data)
dataStruct = data(i);
plot(dataStruct.T, dataStruct.output);
hold on;
end
  댓글 수: 6
SHARAD KUMAR UPADHYAY
SHARAD KUMAR UPADHYAY 2019년 6월 29일
%%It is not a good answer, as these command give same results as i use command
legend('a','b')
TADA
TADA 2019년 6월 29일
True.
I don't know the specifics of your particular problem.
Without more details, that's the best I can offer at the moment

태그

Community Treasure Hunt

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

Start Hunting!

Translated by