matlab

Running on 32 or 64 bit matlab?

How can I determine if I'm running on a 32bit or a 64bit version of matlab? I have some pre-compiled mex-files which need different path's depending on 32/64bit matlab. edit Found solution The function computer returns the architecture I'm running on. so: switch computer case 'GLNX86' display('32-bit stuff') case 'GLN...

In Matlab, what does zpk([], [i, -i], 1) mean?

Hello, please, help me with feedback function and some links. What type of this function: zpk([], [i, -i], 1) ? What resources could I learn to understand it? Thanks. PS. excuse my english :) ...

Why do I get this error message in matlab?

I'm a new user of Matlab, can you please help: I have the following code in an .M file: function f = divrat(w, C) S=sqrt(diag(diag(C))); s=diag(S); f=sqrt(w'*C*w)/(w'*s); I have stored this file (divrat.M) in the normal Matlab path, and therefore Im assuming that Matlab will read the function when its starting and that this function t...

What is the simplest way to export Excel data to Matlab?

What is the simplest way to programmatically export Excel data to Matlab? ...

Best MATLAB toolbox that implements Support Vector Regression?

In this Wikipedia article about SVM there are a number of links to different implementations of MATLAB toolboxes for Support Vector Machines. Could anyone suggest which of these is best in terms of speed, ease of use, etc.? ...

Read and write from/to a binary file in Matlab

My knowledge of matlab is merely on a need to know basis, so this is probably an elementary question. Nevertheless here it comes: I have got a file containing data (16-bit integers) stored in binary format. How do I read it into a vector /an array in matlab? How do I write this data to a file in matlab? Is there any smart tweak to incre...

Plot a data series beneath another one

When you plot things in Matlab, the most recently plotted data series is placed on top of whatever's already there. For example: figure; hold on plot(sin(linspace(0,pi)),'linewidth',4,'color',[0 0 1]) plot(cos(linspace(0,pi)),'linewidth',4,'color',[1 0 0]) Here, the red line is shown on top of the blue line (where they intersect). Is ...

How do properties work in Object Oriented MATLAB?

I am trying to create a MATLAB class with a member variable that's being updated as a result of a method invocation, but when I try to change the property within the class it (apperently, from what I understood from MATLAB's memory management) creates a copy of the object and then modifies it, leaving the original object's property untou...

License to Distribute Matlab code

After writing the code in Matlab, is it possible to compile it into libraries and distribute them to customers who don't have matlab without installing the whole Matlab program? What is the license governing the distribution of Matlab code? ...

How to set some custom variables on Matlab startup

I would like to set some initial variables (like format compact and the current directory) automatically on each startup of Matlab. How can I do that? ...

What's the best way to iterate through columns of a matrix in MATLAB?

I want to apply a function to all columns in a matrix with MATLAB. For example, I'd like to be able to call smooth on every column of a matrix, instead of having smooth treat the matrix as a vector (which is the default behaviour if you call smooth(matrix)). I'm sure there must be a more idiomatic way to do this, but I can't find it, so...

How can I save a very large MATLAB sparse matrix to a text file?

I have a 30000x14000 sparse matrix in MATLAB, which I need to use in another program. Calling save won't write this as ASCII (not supported). Calling full() on this monster results in an Out of Memory error. How do I export it? I use MATLAB 7. ...

Fixing the Radial Axis on MATLAB Polar Plots

I'm using polar plots (POLAR(THETA,RHO)) in MATLAB. Is there an easy way to fix the range for the radial axis to say, 1.5? I'm looking for something analogous to the xlim, ylim commands for cartesian axes. Haven't found anything in the docs yet. Thanks in advance. ...

Correctly over-loading a stringbuf to replace cout in a MATLAB mex file

MathWorks currently doesn't allow you to use cout from a mex file when the MATLAB desktop is open because they have redirected stdout. Their current workaround is providing a function, mexPrintf, that they request you use instead. After googling around a bit, I think that it's possible to extend the std::stringbuf class to do what I ne...

Porting matlab functions to scilab. How to use symbolic?

I'm porting some matlab functions to scilab. The cool thing is that there is a conversion toolbox that make things very easy. The problem is I did not find the counter part to the syms function, and the symbolic toolbox in general. (I'd like a port of the Control System Toolbox too, i'm still searching for some functions I'd may need). ...

Matlab copy constructor

Hi, Is there a better way to implement copy construcor for matlab for a handle derived class other than adding a constructor with one input and explicitly copying its properties? obj.property1 = from.property1; obj.property2 = from.property2; etc. Thanks, Dani ...

Thread safety of Matlab engine API

I have discovered through trial and error that the MATLAB engine function is not completely thread safe. Does anyone know the rules? Discovered through trial and error: On Windows, the connection to MATLAB is via COM, so the COM Apartment threading rules apply. All calls must occur in the same thread, but multiple connections can occ...

Reading text values into matlab variables from ASCII files

Consider the following file var1 var2 variable3 1 2 3 11 22 33 I would like to load the numbers into a matrix, and the column titles into a variable that would be equivalent to: variable_names = char('var1', 'var2', 'variable3'); I don't mind to split the names and the numbers in two files, however preparing matlab code...

plot a 3 axis graph as a mesh

I have seen 3d surface plots of data before but i do not know what software i could use to make it. I have 3 series of data (X, Y, Z) basically i want each of the rows on the table to be a point in 3d space, all joined as a mesh. The data is currently csv, but i can change the format, as it is data i generated myself. Can anyone help ...

How to create a GUI inside a function in Matlab?

Is there a possibility to write a GUI from inside a function? The Problem is: The callback of all GUI-functions work in the global workspace. But functions have their own workspace and can not access variables in the global workspace. Is there a possibility to make the GUI-functions use the workspace of the function? function myvar = m...