Welcome to Scribd. Sign in or start your free trial to enjoy unlimited e-books, audiobooks & documents.Find out more
Download
Standard view
Full view
of .
Look up keyword
Like this
5Activity
0 of .
Results for:
No results containing your search query
P. 1
How To Store Data into AXES FIGURE USERDATA in Matlab

How To Store Data into AXES FIGURE USERDATA in Matlab

Ratings: (0)|Views: 416|Likes:
Published by Jans Hendry

userdata matlab, axes figure, axes userdata, figure userdata, gui matlab, gui programming

userdata matlab, axes figure, axes userdata, figure userdata, gui matlab, gui programming

More info:

Published by: Jans Hendry on Jan 23, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as PDF or read online from Scribd
See more
See less

09/12/2014

pdf

 
[all about matlab] January 23, 2013
 
[janshendry@gmail.com] Page 1
HOW TO STORE DATA IN AXES FIGURE USERDATA IN MATLAB
A good Matlab Programmer while dealing with GUI will avoid using GLOBAL syntax to declarevariables used in the program. The problem is Matlab will preserve much memory when youdeclare variables in each sub_callback. So one has to optimize using every properties that thecontrol has. Usually, we use USERDATA property to store array or single data in Matlab GUI. So wecan access the data anytime. But there is a case when we deal with userdata property of axes figure.This is not as usual as property of others control. So I need to write this article to help whether areader face the same problem.This is not a big issue actually. What you have to do is to avoid putting the syntax before plot command. Because plot command in matlab will reset all the value in USERDATA of current axes.Please see some example below:I want to display my audio signal data to fig1 which is axes object/control. In the same sub_callback,I want to save my data into current axes USERDATA. So what I think best to do is:
h1 = handles.fig1;
 
set(h1,'UserData', data);
 
plot(h1, (1:length(data))/fcuplik, data);
 
set(h1,'YAxisLocation','Right');
 
xlabel(h1,'Waktu (detik)');
 
ylabel(h1,'Amplitudo');
 
set(h1,'Color', [0.945 0.969 0.949]);
 
set(h1,'XColor', [0.847 0.161 0.0]);
 
set(h1,'YColor', [0.847 0.161 0.0]);
 
this is absolutely wrong. Take a look at the row which is dash boxed. I found this is not goodplacement of the code. Because the final result would be an empty cell. So we have to change itsplacement. See below, please:
h1 = handles.fig1;
 
plot(h1, (1:length(data))/fcuplik, data);
 
set(h1,'YAxisLocation','Right');
 
xlabel(h1,'Waktu (detik)');
 
ylabel(h1,'Amplitudo');
 
set(h1,'Color', [0.945 0.969 0.949]);
 
set(h1,'XColor', [0.847 0.161 0.0]);
 
set(h1,'YColor', [0.847 0.161 0.0]);
 
set(h1,'UserData', data);
 

Activity (5)

You've already reviewed this. Edit your review.
1 thousand reads
1 hundred reads
leardpan liked this
sars2906 liked this

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->