Answered
Updating application data from several GUI's
Why not just store all needed information in the root? setappdate(0,'cellarray',cellarray); then from anywhere else: cell...

15 years ago | 1

| accepted

Answered
while loop, user-defined function, to find prime numbers
If the idea is to use a WHILE loop, you should think about what can be checked one at a time. Take N = 9; SN = floor(sqrt(N)...

15 years ago | 0

Answered
need to extract rgb value of image in the format [r g b]
Somehow you don't have the image handle. So try this: IH = findall(0,'type','image'); IM = getimage(IH);

15 years ago | 0

| accepted

Answered
remove slider from Listbox
As Walter says, this cannot be done in MATLAB. I cannot really think of a reason why you would want to do this, but if you have...

15 years ago | 0

| accepted

Answered
Simple Problem - Message Box Function
function messageBox h1=msgbox('Message Display','','none','non-modal'); set(h1,'Deletefcn',@closeMsg); ...

15 years ago | 1

| accepted

Answered
gettting error in this mex file
Did you mex the file? mex pred_lt_3.c You need to mex the file before you can use it.... Also, the beginning { and ending }...

15 years ago | 0

| accepted

Answered
Assign multi-dimension array to data structure array without for-loop
For example: clear T S T = rand(3,3,3); S(1:3) = struct('a', mat2cell(T,3,3,[1 1 1])); isequal(T(:,:,2),S(2).a) % just ...

15 years ago | 0

Answered
Is it possible to replace ranges of a matrix elements using indices from two vectors?
Modified FOR loop for speed... N = 5; X = false(N); for ii = 1:N X(ii,a(ii):b(ii)) = 1; end X = dou...

15 years ago | 2

| accepted

Answered
'fname' variable or function?
Yes, fname is a common moniker for a filename string used in MATLAB. Since you give no details, I cannot guess what kind of fil...

15 years ago | 0

| accepted

Answered
surf cannot be complex
You forgot a couple of dots (g^ -> g.^) in your code. d1 = 0.0002:0.00001:0.0004; g1 = 70:90; [d,g] = meshgrid(d1,g1);...

15 years ago | 0

| accepted

Answered
3d plot change view / reverse axis
Have you tried the command: rotate3d Put this command after your call to SURF, then click on the plot and spin it around t...

15 years ago | 0

| accepted

Answered
using mex for C
Is the name of your file saved on disk as COSENO.C (capitalized and all)?

15 years ago | 0

Answered
undefined function or method 'impl' for input arguments of type 'function_handle'.
Since you are the one using impl, whether it is a function or a variable, why not tell us what it is? If it is supposed to be a...

15 years ago | 0

Answered
Is there a way to record a user action into a script
The short answer is yes. You can use the <http://www.mathworks.com/help/techdoc/ref/input.html INPUT> function to get user inpu...

15 years ago | 0

| accepted

Answered
Sum of Rows
I simply copied and pasted your data into a textfile I named stock_prices.txt, then: % Retrieve the data... fid = fopen('...

15 years ago | 0

| accepted

Answered
sort function
I think you will have to clarify your question more. What do you mean by "in a row?" Does this mean that they are integers sep...

15 years ago | 1

| accepted

Answered
save button condition?
You don't mention what it is that you are protecting, a variable or file for example, so I will speak generally. R = get_name...

15 years ago | 0

Answered
Dumb mistakes we make with MATLAB.
Not so much with MATLAB, but with MATLAB answers. This one has bitten me several times. I will edit an answer I had given ea...

15 years ago | 2

Answered
How to use trapz and cumtrapz
x = -2:.01:2; intg = trapz(x,myfun(x)); Jan beat me to it! But CUMTRAPZ is the cumulative integral on your *data*, not a f...

15 years ago | 1

| accepted

Answered
How does Squeeze work?
In addition to what James said, just look at an example or two. Look what happens to the dimensions of A with squeeze, particul...

15 years ago | 6

| accepted

Answered
Find Min of Matrix without using MIN or explicit loops (FOR or WHILE)
Here is a way to do it without MATLAB loops. Though I think the idea John has in mind would be better! mn = sort(A); mn =...

15 years ago | 0

Answered
make several matrices in a for loop
for ii=0:9 matrix{ii+1} = rand(12,12); end

15 years ago | 3

| accepted

Answered
color of marks in polar plot
Walter hit on the only solution that makes sense to me. It is not that bad, for instance: % Sample Data... A = linspace...

15 years ago | 0

| accepted

Answered
how to add iterations to a matrix as values in a loop and get the inverse of the matrix
There is something you left out. Because this does not error: th2 = 0:1:360; As it is a simple assignment. Post the actual...

15 years ago | 1

| accepted

Answered
How do I change the marker size for a plot?
To make this type of thing much easier, you could download this code so that all these options are available from a simple mouse...

15 years ago | 1

Answered
plot sinc function
ezplot(@sinc) Or, more generally: x = -5:.01:5; plot(x,sinc(x)) This is if you have the signal processing toolbox. If ...

15 years ago | 2

Answered
Sending parameters to a function
Of course, "But it don't work" is _*very*_ vague. <http://www.mathworks.com/matlabcentral/answers/6200-tutorial-how-to-ask-a-...

15 years ago | 0

| accepted

Answered
replacing numbers in columns
Laura's solution will not preserve the order. To preserve the order, do a transpose first. Here is an example: % Sample Dat...

15 years ago | 0

Answered
Label shift when saving to .eps
Try this: <http://www.mathworks.com/matlabcentral/fileexchange/23629 Export_Fig> % % % *EDIT* Try setting the YTickMode ...

15 years ago | 0

Answered
Matlab 2007
I think the problem is that you are calling a function from the base workspace then expecting the variables created in the funct...

15 years ago | 1

Load more