Plot signal from list of data in MATLAB

Click For Summary

Discussion Overview

The discussion revolves around loading data from a .mat file in MATLAB and plotting signals using a graphical user interface (GUI). Participants are seeking assistance with coding and troubleshooting issues related to data loading and plotting.

Discussion Character

  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant requests help with loading a .mat file containing 500 columns of data and plotting it through a GUI.
  • Another participant suggests creating an x vector of size 300 that ranges from 0 to 300 to plot against the y-data.
  • A participant expresses difficulty in loading the .mat file using the 'load' command and shares their current approach, which includes attempting to plot the data after loading.
  • Another request for assistance is made regarding loading a .m file and plotting the signal, including a code snippet for selecting the file through a GUI.

Areas of Agreement / Disagreement

Participants have not reached a consensus, as there are multiple requests for help and varying approaches to loading and plotting data.

Contextual Notes

Some participants' code snippets may not fully address the issues raised, and there are unresolved questions regarding the correct usage of commands and data structures in MATLAB.

kay310
Messages
8
Reaction score
0
I want to load a .mat file which contain 500 column of data in it and plot the signal out through the GUI using .m file.
Can anyone help me on the code?
 
Physics news on Phys.org
So you have a set of y-data of 300. Make an x vector of size 300 that goes from 0 to 300 and then plot(x,y);
 
I'm now actually unable to load the .mat file using 'load' command.
I doing this way in m-file:

load filename;
[x,y] = size(filename);
t = 1:y;
plot(t, filename);

%the filename is in .mat format
 
can anyone help me in load a .m file and plot the signal out?

using this way:
[Filename, PathName] = uigetfile('*.m','Select the M-file');
 

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
Replies
7
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
Replies
7
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 6 ·
Replies
6
Views
5K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K