I know this is really basic, but I am new to matlab. After opening a .fig file, how do you actually work with the data in the command line? All I see is the picture. Im not sure how to actually get the data.
hi, i am looking for a way to implement the "gcd" function used in matlab in another language but i really cant understand the way it functions.
it says in http://www.mathworks.com/access/helpdesk/help/techdoc/ref/gcd.html that:
"[G,C,D] = gcd(A,B) returns both the greatest common divisor array G, and the arrays C and D, which satisfy the equation: A(i).*C(i) + B(i).*D(i) = G(i)."
but it says nothing about how it calculates C and D.
i would be grateful if someone has a clearer idea about this subject!
thanks:)
Hi,
I am drawing a simple bar diagram in Matlab. The problem is, that the value
at x = 0 lets the y-axis disappear partially. Is there a way to bring the y-axis
to the front instead of hiding between the y-value for x=0? Is there any
option I can make sure the y-axis is always in the front?
Many thanks,
Claus
Hey,
I have a simple plot which feature a lot of data points, when i have have graph. Is there a way that i can simple click on all these point and allow matlab to give me a average value of them?
Thank you
I'm running a long simulation in Matlab that I've realized I need to stop and rerun. However, Matlab is really into this calculation, and it's stopped responding. How can I interrupt this run without killing Matlab?
(I realize this is a problem with many windows programs, but it's really acute with Matlab)
Hello,
I am trying to find the area of some regions on an image.
http://img821.imageshack.us/img821/7541/cell1.jpg
For example, I want find the area of the dark-large region on the upper left side.
and I want to find the area of any of the closed geometry from the image.
How can I do that in matlab.
I looked online and I tried regionprops(), but it didn't identify the different regions.
%# load a grayscale image
img = imread('coins.png');
%# display the image
figure
imshow(img,[]);
%# false-color
colormap('hot')
The above code is from here:
http://stackoverflow.com/questions/2592755/infrared-image-processing-in-matlab/2592793#2592793
But I don't understand how figure(What's the difference with/without it?) and colormap(How does it affect the already shown img?) work?
hi, currently in matlab i have int array a=[3,4,5,6,7];
i want to convert it to binary array with four bits each.
for the above int array i would get the following binary array abinary=[0,0,1,1, 0,1,0,0, 0,1,0,1, 0,1,1,0, 0,1,1,1];
is there any fast way to do it? thanks a lot!
I am drawing a simple bar diagram in MATLAB. The problem is, that the value
at x = 0 lets the y-axis disappear partially. Is there a way to bring the y-axis
to the front instead of hiding between the y-value for x=0? Is there any
option I can make sure the y-axis is always in the front?
I am using the following functions for writing and reading 4098 floating point numbers in MATLAB:
Writing:
fid = fopen(completepath, 'w');
fprintf(fid, '%1.30f\r\n', y)
Reading:
data = textread(completepath, '%f', 4098);
where y contains 4098 numbers. I now want to write and read 3 strings at the end of this data. How do I read two different datatypes? Please help me. Thanks in advance.
Hi,
i am looking to implement the interp1, 1-D data interpolation (table lookup), function available in MATLAB in J2ME or JAVA. here is the link
http://www.mathworks.com/access/helpdesk/help/techdoc/ref/interp1.html
Is there any library available in J2ME or JAVA which has already implemented the same function ? If not can anybody help me in implementing interp1 function in J2ME or JAVA ?
This is quite possibly an extremely retarded question, but what is the best way to draw a line over a black and white (binary) image in MATLAB, provided the start and end coordinates are known?
Please note, I am not trying to add an annotation line, I would like the line to become part of the image.
How do you plot two figures at the same time in Matlab? Every time I use surf() it plots over the old one. Also, how do you save the images so you can export them to MS word or powerpoint or something?
In MATLAB, when you click File - New - Function M-File, you get a file with the following contents:
function [ output_args ] = Untitled( input_args )
%UNTITLED Summary of this function goes here
% Detailed explanation goes here
end
Is it possible to override this behaviour, and specify your own text?
(The motivation is that I'm trying to persuade my colleagues to document their m-files more thoroughly, and having default text for them to fill in might encourage them.)
I have a figure that displays 20,000 points on the x-axis. So it
labels the x-axis from 0 ... 20,000. However, now I would like to scale
it from 0 to 50. But when I try to do this in the plot window it just
shows me the first 50 points, instead of changing the scale. Is there
any straightforward way to do that in MATLAB?
Hi there,
I have a pretty simple question, how can I terminate a running script in matlab using a code ? Similar to using CTRL + C
I want the program to stop running if a user enters incorrect digits
Any ideas ?
Thanks
It's from this thread but I'm also interested in this.
How to I filter out pixels not in green channel?
And how to I select a point which is inside a closed box with MATLAB?
Is there a way to specify code to be run whenever an error occurs in Matlab? Googling I came across RunTimeErrorFcn and daqcallback, but I believe these are specific to the Data Acquisition Toolbox. I want something for when I just trip over a bug, like an access to an unassigned variable. (I use a library called PsychToolbox that takes over the GPU, so I want to be able to clear its screen before returning to the command prompt.)
Lets assume that we have a vector like
x = -1:0.05:1;
ids = randperm(length(x));
x = x(ids(1:20));
I would like to calculate the maximum distance between the elements of x in some idiomatic way. It would be easy to just iterate over all possible combinations of x's elements but I feel like there could be a way to do it with Matlab's built-in functions in some crazy but idiomatic way. Any ideas?
How can I see a list of what global variables are defined in MATLAB? (I am using R2009a).
I have hunted unfruitfully for this on Google and SO, so apologies if it has been asked before.
I've been using blockproc for processing images blockwise. Unfortunately, blockproc is part of the Image Processing Toolbox, which I don't have on my personal computer.
Is there a combination of functions in base Matlab that can substitute for blockproc?
My initial guess was to use im2col to transform each block into columns, and then arrayfun to process each column. Then I realized that im2col is also a part of the Image Processing Toolbox, so that doesn't solve my problem.