Output the current state in Stateflow? In Stateflow, is there a way to output to MATLAB the current state of the state machine? That is, without having to manually create a variable that somehow maps to the states and have it output a different value "manually" in each state. Thanks! ... 9 Aug 2010 10:06
Why very different running time for similar codes ? Hi, all I was trying to optimize the speed of my codes and discovered something interesting.. I tried (1) load a mat file and pass the variables into a function vs (2) pass the filename into the function and load mat files inside the function (1) takes 0.003 sec, almost 30 times faster than (2), which takes ... 6 Aug 2010 14:52
Loading specific variables from multiple '-mat' files I am working with data that is saved as numeric integer mat files like 1.mat, 2.mat, 3.mat etc. In each of the mat files, there about 20 variables. I am trying to write a loop that will access all of the mat files but only load into the workspace one variable from each file, 'Xa'. From the other post regarding loadi... 6 Aug 2010 13:46
interpolation NaN data at 3D array Hi- I have an 3D array, A: A(:, :, 1)=magic(5)*0.5; A(:, :, 2)=magic(5)*1; A(:, :, 3)=magic(5)*0.3; A(3, 5, 2)=NaN; A(1, 2, 2)=NaN; I'd like to replace NaN with linearly interpolated value at Z direction. That is, A(3, 5, 2): mean of A(3, 5, 1) and A(3, 5, 3) I wrote a code like this: [X Y Z]=size(A)... 6 Aug 2010 18:11
mxGetData gets garbage To Whomever, I apologize in advance for the length of this post. However, I think you will find it necessary. I am trying to create a MEX function that takes in a couple of matrices as inputs and does stuff to them before outputting other values to the original Matlab function that called the MEX function. My p... 6 Aug 2010 14:52
mxGetData gets garbage To Whomever, I apologize in advance for the length of this post. However, I think you will find it necessary. I am trying to create a MEX function that takes in a couple of matrices as inputs and does stuff to them before outputting other values to the original Matlab function that called the MEX function. My p... 6 Aug 2010 12:40
Eigenvectors with Identical Eigenvalues Lose orthogonality? Shouldn't the command "[V,D] = eig(A);" give an orthogonal basis V? If A has unique eigenvalues I find this to be true, but if A has identical eigenvalues (see code below) the eigenvectors with identical eigenvalues seem to lose orthogonality. Is this a numerical issue with the eig command? and is there a way around ... 6 Aug 2010 15:58
for loop problem Hello, I have a for loop that is iterating every other number for some reason. I can’t figure out why. I put an i in the code right after the for loops first line and the output it is showing is saying that this for loop is counting up by 2’s. here’s the code, I think the really important info is t... 6 Aug 2010 12:40
Evaluate implicit 3d function I have a set of 3d data points (x, y, z) that I want to fit to an ellipsoid, with the implicit function c1*(z-z0)^2 - c2*xz + c1*x^2 + c3*y^2 - c4 = 0. The unkown parameters are c1, c2, c3, c4, z0. This linear system has been solved. My problem is that I want to use the x and y values to calculate new z-values. ... 6 Aug 2010 19:16 |