matlab

How do I roll out a Matlab app for others to use?

I wrote a MATLAB script with gui which I also want to let my-coworkers use. Right now, I always start the gui-builder and run the program out of there. How can I package it together so that it is easy to use and preferably only one file or so. There is also a perl-script which is called out of the program. It only has to work for windows...

Matlab Simulink version control with multiple developers

We're using Matlab Simulink for model development (and Real-Time Workshop autocoding) within a team of several developers. We currently use Visual Source Safe (yes, I know its terrible) for version control, using locks to prevent conflicting changes. We'd like to migrate our programme to a different version control system (svn, hg or g...

Matlab deployment: add files to source control?

I've created a deployment project which works rather well and now I want to add it to source control repository for others to use. The main problem I'm facing is that the .prj file which deploytool creates contains absolute paths which will not work on other computers. So far I've tried the following: Create the stand alone exe using j...

How do I format this data read from a serial port in MATLAB?

I'm trying to interface a digital sensor to my computer via MATLAB. I first send a request for data to the sensor, then the sensor replies with a six byte stream. MATLAB reads the sensor like this: data1 = fscanf(obj1, '%c', 6); I know exactly what the contents of the data is supposed to be, but I don't know how to read the data in ...

Solving for variables in an over-parameterised system

I am trying to write a Matlab program that accepts variables for a system from the user, but there are more variables than system parameters. To be specific, six variables in three equations: w - d - M = 0 l - d - T = 0 N - T + M = 0 This could be represented in matrix form as A*x=0 where A = [1 0 0 -1 0 -1; 0 1 0 -1 -1 0;...

How to joint some objects in digital image?

I'm looking for some algorithm to joint objects, for example, combine an apple into a tree in digital image and some demo in Matlab. Please show me some materials of that. Thanks for reading and helping me!!! ...

drawing an image with RGB data in matlab

I have a text file containing RGB data for an image, how can I draw the image using this data in matlab? data sample : Red Green Blue 80 97 117 83 100 120 74 91 111 81 96 115 81 96 115 77 90 107 84 97 114 78 91 108 79 95 110 91 104 120 94 108 121 ...

How do I display an arrow positioned at a specific angle in MATLAB?

I am working in MATLAB and I'm stuck on a very simple problem: I've got an object defined by its position (x,y) and theta (an angle, in degrees). I would like to plot the point and add an arrow, starting from the point and pointing toward the direction defined by the angle. It actually doesn't even have to be an arrow, anything graphical...

set of n-linear equations in matlab

I have some trouble on setting of n-linear equations in matlab.I don't know how can I declare in matlab.I need matlab code for setting of n-linear equations.. ...

How to plot a 3D plot in MATLAB?

I have three parameters x,y and t. But the problem is my file structure. My files are named as: e_x_y.txt t_x_y.txt where e_x_y.txt has the error for particular values of x and y and t_x_y.txt has corresponding time values. I need to plot the values in e_x_y.txt on a x vs y vs t graph. What is the best way to do that? I know what ...

How to read till end of file in MATLAB?

I have a file a.txt: 03,17.406199 05,14.580129 07,13.904058 11,14.685388 15,14.062603 20,14.364573 25,18.035175 30,21.681789 50,22.662820 The number of rows in the file are not known. I want to read the file and store 3 5 7 11 15 20 30 50 in one array and the float values in another. How do I read in a file when the length of dat...

How To Rotate Image By Nearest Neighbor Interpolation Using Matlab

My Plain Code without interpolation: im1 = imread('lena.jpg');imshow(im1); [m,n,p]=size(im1); thet = rand(1); m1=m*cos(thet)+n*sin(thet); n1=m*sin(thet)+n*cos(thet); for i=1:m for j=1:n t = uint16((i-m/2)*cos(thet)-(j-n/2)*sin(thet)+m1/2); s = uint16((i-m/2)*sin(thet)+(j-n/2)*cos(thet)+n1/2); if t~=0...

Matlab: evaluate symbol expression

syms t; % define symbolic var x y = int( t^2 ); % calculate integral of x; it should be t^3/3 x = [1:10] Now I want to calculate y(x), it should be [1/3,8/3,..,1000/3] ...

How would I randomly pick one point from N points in MATLAB?

I use this code to create and plot N points: N = input('No. of Nodes:'); data = rand(N,2); % Randomly generated n no. of nodes x = data(:,1); y = data(:,2); plot(x,y,'*') hold on How would I randomly pick one of these points? ...

MATLAB How to divide a matrix into equals parts?

Let's say I have a 100x100 matrix, I want to divide it into equals parts of 10x10. The problem is that the input matrix can be of any size but always mod 10. I looked at the mat2cell function but it does not seem to work for a dynamic number of parts. Or am I missing something? Thanks! ...

How do I execute a callback function from another function file in MATLAB?

I have two functions: one which creates the UI with buttons, and another one from which I'd like to execute the same function as pressing the button does. When I dig into the figure with get(gcf,'children') I find the buttons, with a Callback property that looks like this: ans = [function_handle] [ 1] [ ...

Cut Polygon Function in Matlab

Is there an existing matlab implementation of cut polygon function? Such as the one that is based on this? I understand that we have this implementation, but looking at the source code, I don't think this is a correct implementation ( just my hunch) because it distinguishes vertical and horizontal lines in the checking ( A good algorit...

Function pointers in MATLAB

If I use the inline function in matlab I can create a single function name that could respond differently depending on previous choices: if (sometimes) p = inline('a - b','a','b'); else p = inline('a + b','a','b'); end c = p(1,2); d = p(3,4); But the inline functions I'm creating are becoming quite epic, so I'd like to move them ...

How do you sum values inside a for loop in Matlab?

I want to sum acidic as the for loop runs and then print out the total value of all the previous acidic values. My problem is right now is it is currently just printing the individual values not one summed value of acidic. How do I sum. this is what is printing to the command window ans = 5.9676 ans = 2.1676 here is my code pki ...

Is there a way to push a MATLAB workspace onto a stack?

Does anyone know if it's possible to have a stack of workspaces in MATLAB? It would be very convenient, to say the least. I need this for research. We have several scripts which interact in interesting ways. Functions have local variables, but not scripts... ...