MATLAB Answers

plotting 2 .mat fikes ith the same variable name

1 view (last 30 days)
Chantal Lewis
Chantal Lewis on 6 Nov 2019
Answered: Katie on 6 Nov 2019
hello,
how do i plot data from 2 different .mat files whihc contain data using the sam variable names without overwriting the data

  0 Comments

Sign in to comment.

Accepted Answer

Katie
Katie on 6 Nov 2019
When you load the .mat files you can store the contents in two different variables and then dot index your variables:
Data=load('file1.mat');
Data1=load('file2.mat');
figure;
plot(Data.x, Data.y);
hold on;
plot(Data1.x, Data1.y);

  0 Comments

Sign in to comment.

More Answers (0)

Tags

Products


Translated by