matlab

embedding matlab code in a browser?

can I run matlab code in a browser somehow? I can always convert the code to flash or php or java but I am just being lazy. I would like to embed the matlab simulations I have in a browser somehow. doable? ...

MATLAB parfor is slower than for -- what is wrong?

Hi, the code I'm dealing with has loops like the following: bistar = zeros(numdims,numcases); parfor hh=1:nt bistar = bistar + A(:,:,hh)*data(:,:,hh+1)' ; end for small nt (10). After timing it, it is actually 100 times slower than using the regular loop!!! I know that parfor can do parallel sums, so I'm not sure why t...

MATLAB how to combine uneven matric into single matrix

dt1 dt2 dt3 dt 1 3 6 10 2 4 1 5 3 6 5 3 4 7 4 1 5 1 2 4 6 2 8 7 8 8 9 10 I have the above data which I want to combine in one single matrix (10 x 4). The maximum number of row is 10. I created zeros matrix, however I have problem since the data doesn't have the same dimension. How it is poss...

Matlab combine matrix

student1 student2 student3 code score code score code score 1 20 1 100 1 22 2 11 3 11 2 90 3 12 4 22 5 11 4 11 5 28 This question is related to http://stackoverflow.com/questions/3174631/matlab-how-to-combine-uneven-matric-into-single-matrix but a li...

Making plot of matrix entries using Matlab

I've got a matrix A=magic(4) and wish to plot the values using plot3(1:4,1:4,A,'ks'). But that plots everything on the diagonal and not where they actually are relative to the other values in the matrix. How do I do that? I'm sure it's pretty easy but I'm new to matlab. ...

problem im motion control with MATLAB

hello i have a problem in motion control in matlab imagine a four bar linkage mechanism like this.as you you know in an ordinary 4 bar linkage we have 2 fix points but here we have just one & the second one it fixed to a pinion (small gear).we have the ratio of gears so we have a relation between teta1 & teta2 teta2 = 5*teta1 (the mec...

MATLAB how to plot x,y on image and save

datafile.txt code x y 23 22.1 33.11 23 110 22 23 11 200 24 111 321 24 222 111 24 10 22.1 10 88.3 99.3 10 110 32 10 121 143 10 190 200 EDITED: On the above file, the first column represent the image code which displayed on screen, and the x and y represent the point where people lo...

MATLAB - concatenating items within a cell array

Hi, I have a cell array: X = {1x2} {1x2} X{1} = '' A X{1 2} = 10 113 I wish to concatenate the sub cells in such a way that Y = 10 113A Thanks, S :-) ...

Matlab how to avoid jagged image

How to avoid jagged image in matlab. I have 600 x 600 image opened in matlab and do some processing on the image. However when I save it, it look so blur and jagged. What should I do? EDITED: this question is related to my previous question here http://stackoverflow.com/questions/3178336/matlab-how-to-plot-x-y-on-image-and-save fid=fop...

MATLAB is running out of memory but it should not be.

I'm trying to do a PCA on my data using princomp(x) that has been standardized. The data is <16 x 1036800 double>. This runs our of memory which is too be expected except for the fact that this is a new computer, the computer holds 24GB of RAM for data mining. MATLAB even lists the 24GB available on a memory check. Is MATLAB actually run...

Matlab how to show x,y coordinate

How to show both x,y coordinate mapped on image? x = 12; y = 54; plot(x,y,'+ b'); % this show only the "+" symbol. How to show the both coordinate and the "+" ...

Plotting question in Matlab

Is it possible to use the surf function to plot markers, e.g. surf(x,y,z,'some marker')? ...

How to convert c code to matlab

I have a c code about 1200 lines long and i want to convert it into matlab. is there any software or website where i can do it. ...

How can I create large random vectors efficiently, without resorting to loops?

Problem statement:- I want to create 50 instances of a vector(1 Dimension) which contains random real numbers(float). The array size(1 dimension) will be say 30 thousand.How do i proceed so that the overhead is minimum or complexity is minimum? ...

Tiling matrices in matlab

Hi, Here's an interesting question :) I have two "vectors of matrices" which I want to tile like the hankel function does for regular vertices. For example: Column Vector: 10 00 20 00 30 00 Row vector: 30 40 50 60 00 00 00 00 The resulting matrix needs to be: 10 20 30 40 00 00 00 00 20 30 40 50 00 00 00 00 30 40 50 60 00 00 ...

send data over serial port with Matlab

Hello, I'm trying to use Matlab to send the codes 132 and 136 via the serial port. However, I'm not receiving the values I expect. Does anybody know how to do this?!? Thanks very much, Rogier ...

How to find a 1x3 matrix with resultant as zero matrix in Matlab

I know a 3x3 matrix M, and I want to find a 1x3 matrix P. The given condition is: [p1 p2 p3]*[m11 m12 m13; m21 m22 m23; m31 m32 m33] = [0 0 0] Given is [m11 m12 m13; m21 m22 m23; m31 m32 m33] I have to find non trivial (non-zero) solution of [p1 p2 p3] using Matlab. I am wanting to be done in Matlab because its part of a code. If ne...

Animating Multiple Ellipses

sRMatTemp = [SENSORRANGE]; sRMat = repmat(sRMatTemp, size(obj.landmarks.sensed(:,1), 1)); ellipse(((2*pi*sRMat)/(360/obj.landmarks.sensed(:,4))), obj.landmarks.sensed(:,5) , obj.landmarks.sensed(:,3), obj.landmarks.apparentPositionsST(:,1), obj.landmarks.apparentPositionsST(:,2)); The above code works fine... ONCE. The problem is I ne...

Calling (or running) a simulation software from Matlab

I have run simulations on software (named CMG) using command prompt. The command prompt works well in all respect of running the software as well as generating reports and output files. To generate an ouput file (.rwo format) containing the desired result, we have to run the executable of the report program which uses a parameter file (....

MATLAB: why would an axis have its position property changed?

I'm working on a custom plot on top of which I add a second blank axis object to show a secondary scale on the right hand side of the graph (as well as the primary scale on the left hand side). Works great (and had been, for years), until I tried it again recently in R2010a and for some reason the primary axis gets its Position propert...