matlab

Image Shuffling with another image

This is in continuation to a question Image Shuffling in one of my threads %# scramble autumn.tif with itself img1 = imread('autumn.tif'); %# scramble [dummy,scrambleIdx] = sort(img1(:)); img2 = img1; img2(:) = img1(scrambleIdx); %# note the (:). If you don't use it, img2 becomes a vector %# unscramble [dummy2,unscrambleIdx] = ...

MATLAB plot x,y from Loop

I wonder why these two code doesn't produce the same plot? code 1: x=[2,5,7]; y=[10,4,3]; plot(x,y); code 2: x=[2,5,7]; y=[10,4,3]; for i=1:length(x) xx=x(i); yy=y(i); plot(xx,yy); end EDITED: How I can make the output of Code 2 similar to output in Code 1 ...

using mat file in C++ program

Hi Please.. any one help me I have Mat file include struct of array for features vectors, I need to use this file in C++ program. How can I load this file in my C++ program? ...

How to enable auto word completion at matlab editor ?

Hello , I am a new user of matlab . i can use auto word completion at matlab command promt by tab . but i can not do that while using the editor for m file . Is there any option using the editor , Than please inform me . thank you . ...

Matlab unable to open the .dat file as data file when calling a software using 'system'

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 (.rwd format). The output file is ReportBHP1.rwo, this file will contain the variable exported. Now to implement this in Matlab, below is a small script giving a gist of what I am trying ...

Matlab choose random color for plotting

I have 6 vectors which I want to plot. How I can make each plot with different color (random)? With the code below, the plot limited to one color for all six vectors. plot(x,y,'-rs','LineWidth',1,... 'MarkerEdgeColor','k',... 'MarkerFaceColor','g',... 'MarkerSize',5); ...

Text and Plots in Matlab to LaTeX

I like to create a "report generation" script in Matlab. Suppose we have a Matlab array, data and we want to export the following to a .tex file: "The information in the first element of data is X." This would be followed by a plot of X. I have already tried help latex in Matlab and aware of the various packages on Matlab file exchang...

MATLAB: comparison of cell arrays of string

I have two cell arrays of strings, and I want to check if they contain the same strings (they do not have to be in the same order, nor do we know if they are of the same lengths). For example: a = {'2' '4' '1' '3'}; b = {'1' '2' '4' '3'}; or a = {'2' '4' '1' '3' '5'}; b = {'1' '2' '4' '3'}; First I thought of strcmp but it would r...

ellipsoid using matlab

This is a class assignment. I had written some codes which I hope someone can help me. This is the code that I have % --- This is optional to verify whether my parametrization is consistent with the % --- original equation % syms x y z p t % ellipsoid=[2*sin(p)*cos(t),4*sin(t)*sin(p),sqrt(2)*cos(p)] % simplify(subs((x^2/4)+(y^2/16)+(...

Reading TDM (Diadem) files from script

My customer is sending TDM/TDX files captured in National Instruments Diadem, which I haven't got. I'm looking for a way to convert the files into .CSV, XLS or .MAT files for analysis in Matlab (without using Diadem or Diadem DLLs!) The format consists of a well structured XML file (.TDM) and a binary (.TDX), with the .TDM defining how ...

Is there anything like 'whereis' in MATLAB?

I have a line in the code I'm working on like this: feval('func_name', myArg); And it works, but I want to know where func_name is. I can't step into feval to see where it is finding func_name. Instead of (or in addition to) just doing func_name, how can I get MATLAB to tell me where it found it? ...

how to plot 3d graph (network) matlab?

I want to plot a 3d graph in matlab By graph I mean in the sense of nodes and edges. I have an adjacency matrix as well as a coordinate matrix for every node. Eventually I would hope to colour these nodes and edges The gplot function is only 2d. The scatter3 function does not allow for edges. Any ideas? ...

Concatenate arrays of subclasses of the same superclass in MATLAB

I have the following structure in matlab superClass < handle subClassA < superClass subClassB < superClass say I have a vector A of subClassA and a vector B of subClassB. I would like to combine them like this: superVector = [A B]; but Matlab doesn't like this. What's the proper way to cast the subclass back to the superclass...

Matlab, graph two data series in one graph

In MATLAB, is it possible to create a single graph of two related data sources with the first source plotted along the bottom of the x-axis and the 2nd source plotted down from the top of the x-axis? I can't find anywhere in the MATLAB documentation where this is done. The final graph I need is in a form like this: ...

How to determine if two jpg images of the same size have more than 30% of different pixels with matlab?

Or is there a built-in function that can do exactly this job? ...

Save a plot in Matlab as a matrix

Hi! Just imagine you plot several dots, circles, lines in a figure. Afterwards another m file should use this plot as an input to do e.g. thresholding. I'm aware of the print command but I don't want the plot to be stored as file. I would prefer to store it in a matrix (x_dim,y_dim,3). Any ideas? ...

Is there a way to fix all MATLAB mlint messages at once?

I've inherited some code where the author had an aversion to semicolons. Is it possible to fix all the mlint messages in one go (at least all the ones with an automatic fix), rather than having to click each one and press ALT+ENTER? ...

How to get the content of an embedded MATLAB function

In my Simulink model are some embedded MATLAB functions. Is there a way to get the content (the text you see in the editor) of this blocks? My first guess was to use find_system to get the embedded MATLAB functions and then get_param to get the content. But I dont find the needed parameter name. The documentation didnt show up any param...

MySQL and MATLAB 64 bit

I'm trying to connect to MySQL using MATLAB R2009b 64 bit and the mysql.cpp file found on the FEX and here. I followed all the steps to compile listed in the second link. After entering the following: mex -I"C:\mysql\include" -DWIN32 mysql.cpp "C:\mysql\lib\opt\libmySQL.lib" the mysql.mexw64 file is created in my working directory. Ho...

What is the alternative to preallocating arrays in MATLAB?

Possible Duplicate: Growable data structure in MATLAB So in my current MATLAB script, I have a very large indeterminate-sized growing array. There is currently nothing I can do about it, because if I actually preallocate, it would take many many many times more memory than it should need (maximum possible amount of values is 6...