Risposto
Optimizing a 'for' loop
Hi, you should do the strcat out of the loop, something like PT12 = strcat(PT{1,1}(:,1), PT{1,2}(:,1)); and then you ...

oltre 11 anni fa | 1

| accettato

Risposto
Matlab function runtime in Simulink
Hi Tim, Simulink does not simulate in Real-Time. So if a step of 1s of simulation time takes 0.01s of computer time or an hou...

oltre 11 anni fa | 0

| accettato

Risposto
Multiple Matlab installations with diferent mex compiler?
Hi Jonas, multiple MATLAB installations do not share the same preferences, but 32/64 bit, that's right. One simple strategy i...

oltre 11 anni fa | 0

Risposto
How to speed up surf plot for thousands of objects ?
Hi, parfor won't work, because the figure you plot to is bound to the MATLAB desktop you work on. You can transfer computatio...

oltre 11 anni fa | 0

Risposto
Need to get rid of an eval and loop
Hi, to start with, I would suggest to do a data_i = eval(sprintf('data%d', i)); at the very beginning of the i-loop a...

oltre 11 anni fa | 0

Risposto
Saving a matlab figure file without displaying it
Hi, you might open the figure invible: f = figure('visible', 'off'); surf(peaks); print -djpeg test.jpg close(f) I...

oltre 11 anni fa | 6

| accettato

Risposto
Run one function only once when the function starts everyday or some time period
Hi, you mean something like this: function Data() l = login(); code of data processing....etc function aLogin =...

oltre 11 anni fa | 1

Risposto
Using DLL functions with parfeval
Hi Alexander, using loadlibrary will load the dll only to the client MATLAB, not to the pool workers. You will need to do this ...

oltre 11 anni fa | 1

| accettato

Risposto
export a jar file from MATLAB
Hi, MATLAB is MATLAB, .jar is Java. There is no "export of a jar file". But there is a product called MATLAB Builder JA (see ...

oltre 11 anni fa | 0

Risposto
co-existing matlab compilers
Yes. Multiple MCR versions on one machine are no problem. The compiled application always looks for the exact match, regardless ...

oltre 11 anni fa | 0

Risposto
Hold plot for several different cases
Hi, the simplest would be to add after the plot command: plot(handles.plot,x,y,'DisplayName',name,'Color',color); hol...

oltre 11 anni fa | 0

Risposto
mex folder with all elements
Hi, not really. You can add all files of one folder by /my documents/*.cpp but that doesn't include sub folders. You ...

oltre 11 anni fa | 1

Risposto
Pass parameters to simulink executable
Hi Stefano, you pass the parameters as .mat file via command line parameter to the executable. How to do this is described in...

oltre 11 anni fa | 0

Risposto
MATLAB deploytool not working, fails while building.
Hi Ivan, did you change the version of the JDK? You don't have to use the exact same, just the same major version. So if your...

oltre 11 anni fa | 0

Risposto
Problem with factorial recursive function
Hi Arun, your code does not work for arrays because of the "if n<=1". You would need to do something like idx = (n>1); ...

oltre 11 anni fa | 1

Risposto
Code optimization (3 line function)
Hi, one thing that comes to my mind: can you swap rows and columns, i.e., transpose your input matrix? function Y = refl...

oltre 11 anni fa | 1

Risposto
How can I write all month's last dates for a given period of time?
Hi, first of all: you don't need the loop BigMatrix = b + (1:a); BigMatrixStr = cellstr(datestr(BigMatrix)); For the...

oltre 11 anni fa | 1

| accettato

Risposto
How to convert distinct strings in a cell array to numbers.
Hi, something like this: x = {'Loc' 'Buf' 'Cac' 'Loc' 'Cac' 'Buf' 'Buf' 'D'} [C,~,ib] = unique(x); % the unique s...

oltre 11 anni fa | 1

Risolto


Simple equation: Annual salary
Given an hourly wage, compute an annual salary by multiplying the wage times 40 and times 50, because salary = wage x 40 hours/w...

oltre 11 anni fa

Risposto
Class using static method causes clear warning
Hi Hakan, instead of a static method you could use a constant property. BTW, what version of MATLAB do you use? I remember th...

oltre 11 anni fa | 0

| accettato

Risposto
Using mex variable_name; where variable_name contains filename to be compiled
Another way of doing this is similar to other functions, that are often used this way as save, load, etc. Use the functional for...

oltre 11 anni fa | 0

Risposto
how to find mean from cell
Hi, first of all, why do you convert the matrix to a cell? Why not call mean for M? It should give you the mean for all colum...

oltre 11 anni fa | 0

Risposto
C++ shared library compiling/packaging errors
Hi, I'm not sure, but I could imagine it's the name "main". In C/C++ the main function has a special meaning (and a special s...

oltre 11 anni fa | 1

| accettato

Risposto
Optimization Of Function, Curve Fitting
Hi Mike, if you have the Optimization Toolbox available, take a look at the function doc lsqcurvefit It is exactly fo...

oltre 11 anni fa | 0

Risposto
I did not find in the documentation. What is the meaning of set(0,....). What does 0 signify?
Hi, the 0 is the root of the graphics system. It contains information like screen resolution: get(0) CallbackO...

oltre 11 anni fa | 0

Risposto
How to Add a Header file(#include"*.h") from simulink ?
Hi, under the code generation pane for the Simulink Configuration there is the entry "Custom Code". Here you can add you head...

oltre 11 anni fa | 2

| accettato

Risposto
MCR v7.16 Problem
Hi, you will need to install the correct MCR on "the other" computer. You find the MCRInstaller in your R2011b installation u...

oltre 11 anni fa | 0

Risposto
Matlab Coder / Compiler and Classes
Hi David, leaving the speedup aspect aside another option would be to use MATLAB Compiler and MATLAB Builder NE <http://www.m...

oltre 11 anni fa | 0

| accettato

Risposto
Attempt to reference field of non-structure array.
Hi, please use the code button to format your code. I assume the error happens at the line rowa=scana.data(:,end); Ta...

oltre 11 anni fa | 0

Risposto
Cpp file in Matlab
Hi, you will need to tell mex where to find the include files, and probably also the library files. Your call should look som...

oltre 11 anni fa | 0

| accettato

Carica altro