Answered
Loading .mat files with same variable name
Hi, the main idea is to use load with a return argument instead of as a command, something like files = dir('*.mat'); ...

10 years ago | 4

| accepted

Answered
Loop over fieldnames in a matlab structure
Hi David, generally speaking you seem to know how to loop on fieldnames ... I'm not sure now where your problem is? You can c...

10 years ago | 5

Answered
Conditionally replace matrix elements from other corresponding matrix
Hi Matt, two changes: you need to use "&" instead of "&&" to work for vectors, and you need to index into Y the same way. ...

10 years ago | 2

| accepted

Answered
Unrealistic results from integration
Hi, I'm not getting the values that are supposed to be the correct values, but here is a slightly cleaner version of your cod...

10 years ago | 0

Answered
How can I use all MATLAB functions in C# ?
Yes and no: * You can use the <www.mathworks.com/help/matlab/calling-matlab-engine-from-c-c-and-fortran-programs.html MATLAB ...

10 years ago | 0

Answered
How can I write a function for the below cell array comparison?
Hi Supreet, I think this is one of the cases where a simple loop is easier than trying to do something very clever: X = ...

10 years ago | 0

Answered
Calculus with MATLAB, area under the curve
Hi, the "area under a curve" is also known as integrating the function. This should give you a starting point for searching ....

10 years ago | 0

Answered
Combining multiple .m files and a .fig file into one?
Hi, on more recent versions there is the tab "APPS" where you can package your code via the button "Package App". Titus

10 years ago | 0

| accepted

Answered
Hi in have created .exe file from .m file using MCC but still not able to run the exe file without matlab .
Hi, did you run the MCR Installer on the machine not having MATLAB? Take a look here how it works: <http://www.mathworks.com...

10 years ago | 0

Answered
I have 3*3*20 matrix and 1*1*20 matrix. how to multiply. I have multiply q and za
Hi Ranjan, if you want to multiply each 3x3 Matrix q(:,:,idx) with the corresponding za(1,1,idx), then this should work: ...

10 years ago | 2

| accepted

Answered
How can the output of a order character string stored in a variable?
Hi xosro, I'm not sure if this is what you want, but names = {A(1:2).name} collects the names into a cell array (or {...

10 years ago | 0

| accepted

Answered
Trying to compile C++ Code to call it from Matlab. Issue with dependencies. Please help! :)
Hi, looking at the code and the line #include <execinfo.h> with < > instead of " " indicates that this is a system h...

10 years ago | 0

Answered
"week.m" file disapeared
Hi, EDIT: my answer below is not correct, but the comment explains what's going on. Hmm, are you sure this is a MathWorks ...

10 years ago | 1

Answered
Why I'm getting this error?
Hi, as the error indicates: have you installed on the machine where you want to run the jar file the MCR (MATLAB Compiler Run...

10 years ago | 0

Answered
Permute works extremely slow with large arrays
Hi Arseny, this is indeed a rather large array, it needs about 10.4 GB of memory. For the permutation, another 10.4 GB are us...

10 years ago | 2

Answered
Assigning file name as variable name
Hi, you should use name as a variablename to importdata: name = input('Enter the name of a file: ','s'); s=importdata(n...

10 years ago | 0

Answered
Rounding Vector Entries with zeros after the decimal place to integers
Hi, use Azzi's answer if displaying of results is what you after. If you want to eliminate some numerical noise from values t...

10 years ago | 0

| accepted

Answered
Colour data from a vlaue
Hi Toby, yes, colormap is usually used in connection with graphics. But there is nothing wrong in using the values for your p...

10 years ago | 0

Answered
error in compiled version of GUI
Hi Amanda, it might happen that your code crashes within the subfunction Add_Index_To_DataCentral. In this case, the output v...

10 years ago | 0

Answered
Wrong result when using BLAS dot product routine (DDOT) from a MEX file
Hi, you need to change the variable definition of m and one and use two variables for "one": ptrdiff_t m, one1 = 1, one2...

10 years ago | 0

| accepted

Answered
Single Figure is Required
Hi, replace the line fig=figure('Visible','on'); by subplot(5, 1, m); Titus

10 years ago | 0

| accepted

Answered
Detect in simulink if the current and past 4 values are same or not
You can use 4 delay blocks, and feed x_t and x_{t-1} into one relational block, x_{t-1} and x_{t-2} into the next relational blo...

10 years ago | 0

| accepted

Answered
25^23 without approximation
Use vpa from symbolic toolbox: digits(50); x = vpa(25); x23 = x^23 Titus

10 years ago | 1

| accepted

Answered
executable standalone with mex file
Hi Enrico, you need to make sure that the mex file can load the synview.dll (files), which I guess are somewhere "near" your ...

10 years ago | 0

Answered
Access the array index using find
Hi, I guess you are looking for this: A1 = [1 12 23 45]; A1_1 = [45 23]; [~,idx] = ismember(A1_1, A1) idx = 4 ...

10 years ago | 1

Answered
Should parallelization be switched on manually
Hi, on first sight it looks as if the loop on D for i=1:size(D,1) k0(i,:)=D(i,:); opti...

10 years ago | 0

Answered
pixel data from mex to matlab: mxArray definition..
Hi Enrico, as a .bmp it probably has 24 bits, i.e., you iBytesPerPixel is 3. Therefore you should allocate a 1600x1200x3 matr...

10 years ago | 0

| accepted

Answered
command similar to setdiff for case insensitive
Hi, if two commands is fine as well, you can do the following: % find index of elements in a that are in b: [flag,idx...

10 years ago | 0

| accepted

Answered
Hidden call of m-file
An alternative is to go to the simulink preferences and enable "Callback tracing". Then you will see a printout in the command w...

10 years ago | 1

Answered
How to append multiple .mat files that have the same variable names in them?
Hi Alex, yes, that's possible. * Use dir to read all the files * Use the functional form of load, i.e. data = load(f...

10 years ago | 0

Load more