Answered

Generate the same random number stream with for and parfor loop

Hi, this can't work by design: the number generator in the client generates 16 random numbers (and reshapes to 4x4 matrix). ...

Generate the same random number stream with for and parfor loop

Hi, this can't work by design: the number generator in the client generates 16 random numbers (and reshapes to 4x4 matrix). ...

más de 3 años ago | 1

Answered

(Container)Map with array keys

Hi, no, there is no "nice" way of doing this. Using a scalar should work fine though: a = [42 23]; % assume that yo...

(Container)Map with array keys

Hi, no, there is no "nice" way of doing this. Using a scalar should work fine though: a = [42 23]; % assume that yo...

casi 4 años ago | 0

| accepted

Answered

how to get selected values from a listdlg?

Hi Mohammad, m(selection) should do the trick ... Titus

how to get selected values from a listdlg?

Hi Mohammad, m(selection) should do the trick ... Titus

casi 4 años ago | 0

| accepted

Answered

How to use matlab 'spline' function in simulink ?

Hi, the error message tells you what to do, namely "declare" spline as being used not by code generation but by MATLAB: ...

How to use matlab 'spline' function in simulink ?

Hi, the error message tells you what to do, namely "declare" spline as being used not by code generation but by MATLAB: ...

casi 4 años ago | 0

| accepted

Answered

The most close approximation to zero

Hi, there are some aspects to this question. The smallest number you can represent is much smaller: realmin ans = 2....

The most close approximation to zero

Hi, there are some aspects to this question. The smallest number you can represent is much smaller: realmin ans = 2....

casi 4 años ago | 0

| accepted

Answered

how can i call a model from simulink to matlab?

Hi, the sim function is for this purpose: doc sim Titus

how can i call a model from simulink to matlab?

Hi, the sim function is for this purpose: doc sim Titus

casi 4 años ago | 0

Answered

i m getting this error : Undefined function 'activecontour' for input arguments of type 'uint8'.

Hi, activecontour is from Image Processing Toolbox. Do you have it installed? What does ver('images') say and li...

i m getting this error : Undefined function 'activecontour' for input arguments of type 'uint8'.

Hi, activecontour is from Image Processing Toolbox. Do you have it installed? What does ver('images') say and li...

casi 4 años ago | 0

Answered

Optimization with fminsearch and looping

Hi, what do you expect [0.2 0.5 1 1.5]:[0.25 0.6 1.1 1.6] to be? In fact it's 0.2, and I guess your suki expects a ve...

Optimization with fminsearch and looping

Hi, what do you expect [0.2 0.5 1 1.5]:[0.25 0.6 1.1 1.6] to be? In fact it's 0.2, and I guess your suki expects a ve...

casi 4 años ago | 0

Answered

How to skip error and continue to execute the code

Hi Jason, one way would be to catch the error: for i=1:100 try NonData=[Weight;Height;Age]; % do so...

How to skip error and continue to execute the code

Hi Jason, one way would be to catch the error: for i=1:100 try NonData=[Weight;Height;Age]; % do so...

casi 4 años ago | 1

| accepted

Answered

How to get my original x & y data from saved sfit?

Hi, the .sfit is basically a .mat file. So you can load it: v = load('yourfile.sfit', '-mat'); Depending on the numbe...

How to get my original x & y data from saved sfit?

Hi, the .sfit is basically a .mat file. So you can load it: v = load('yourfile.sfit', '-mat'); Depending on the numbe...

casi 4 años ago | 0

| accepted

Answered

Switch statement not recognizing a valid input

Hi, it must be then that the two strings are not equal. Put a breakpoint before the switch and compare str{val} with 'RCS (dB...

Switch statement not recognizing a valid input

Hi, it must be then that the two strings are not equal. Put a breakpoint before the switch and compare str{val} with 'RCS (dB...

casi 4 años ago | 1

| accepted

Answered

Unique elements in matrix efficiently

Hi, a rather simple version would be this: B = -ones(size(A)); for row=1:size(A, 1) val = unique(A(row,:)); [...

Unique elements in matrix efficiently

Hi, a rather simple version would be this: B = -ones(size(A)); for row=1:size(A, 1) val = unique(A(row,:)); [...

casi 4 años ago | 0

Answered

plot approximation and absolute error of taylor series of e^x

Hi, I guess the main error is to not sum: add f=1 in front of the loop and change f = f + (x.^n) / factorial(n); If y...

plot approximation and absolute error of taylor series of e^x

Hi, I guess the main error is to not sum: add f=1 in front of the loop and change f = f + (x.^n) / factorial(n); If y...

casi 4 años ago | 0

Answered

Interpolate from curve data

Hi Daniel, What about this? % define the polynomials y_150 = @(x) 22*((x-23)/4.9).^4 - 48*((x-23)/4.9).^3 + 27*((x-23)/...

Interpolate from curve data

Hi Daniel, What about this? % define the polynomials y_150 = @(x) 22*((x-23)/4.9).^4 - 48*((x-23)/4.9).^3 + 27*((x-23)/...

casi 4 años ago | 0

| accepted

Answered

find unique rows of cell array

Hi Matlab User, that's probably not very easily solved. This should work: i = 1; while i<size(matching__, 1) idx =...

find unique rows of cell array

Hi Matlab User, that's probably not very easily solved. This should work: i = 1; while i<size(matching__, 1) idx =...

casi 4 años ago | 0

Answered

Storing data and Matlab Production Server

Hi Robert, first of all, MATLAB Production Server usually assumes the algorithms to be "state-less", which means, that subseq...

Storing data and Matlab Production Server

Hi Robert, first of all, MATLAB Production Server usually assumes the algorithms to be "state-less", which means, that subseq...

casi 4 años ago | 1

| accepted

Answered

I have a problem with log while implementing vague shadow mask but the R component is already in uint8.

Hi, you need to convert back to double: r = log(double(r)); If you afterwards go back to uint8 (which probably makes ...

I have a problem with log while implementing vague shadow mask but the R component is already in uint8.

Hi, you need to convert back to double: r = log(double(r)); If you afterwards go back to uint8 (which probably makes ...

casi 4 años ago | 0

Answered

xlim not working with datenum??

Hi Aaron, here is an example how it works: % three years: t = datenum(2012, 1:36, 1)'; plot(t, rand(size(t))) % mak...

xlim not working with datenum??

Hi Aaron, here is an example how it works: % three years: t = datenum(2012, 1:36, 1)'; plot(t, rand(size(t))) % mak...

casi 4 años ago | 1

Answered

Interpolate from curve data

Hi, the simplest way would be linear interpolation between two curves, e.g. for 180: y_180 = @(x) ((200-180)*y_150(x) + ...

Interpolate from curve data

Hi, the simplest way would be linear interpolation between two curves, e.g. for 180: y_180 = @(x) ((200-180)*y_150(x) + ...

casi 4 años ago | 1

Answered

xlim not working with datenum??

Hi, I'm not yet sure what is the problem. You limit the X-axis to the following date range: >> datestr(1e5 * [7.2592 ...

xlim not working with datenum??

Hi, I'm not yet sure what is the problem. You limit the X-axis to the following date range: >> datestr(1e5 * [7.2592 ...

casi 4 años ago | 0

Answered

i created a matlab code which take data from an excel sheet and gives me first row of it into a text file. after making .exe of the program i am not able to find the output file. what to do now ?

Hi Vaishvik, when you open the text file for output (using fopen, dlmwrite or whatever...) use disp to print out the path. St...

i created a matlab code which take data from an excel sheet and gives me first row of it into a text file. after making .exe of the program i am not able to find the output file. what to do now ?

Hi Vaishvik, when you open the text file for output (using fopen, dlmwrite or whatever...) use disp to print out the path. St...

casi 4 años ago | 0

Answered

Read and write multiple times in excel document - for loop or?

Hi Jakob, xlsread in the background opens Excel, reads the data and closes it. This takes some time, therefore I would sugges...

Read and write multiple times in excel document - for loop or?

Hi Jakob, xlsread in the background opens Excel, reads the data and closes it. This takes some time, therefore I would sugges...

casi 4 años ago | 0

Answered

Timing multiple Matlab functions

Hi, here is some code how you can test: function testfactorial n = 150; t1 = timeit(@() fact1(n), 1) t2 = timeit(@(...

Timing multiple Matlab functions

Hi, here is some code how you can test: function testfactorial n = 150; t1 = timeit(@() fact1(n), 1) t2 = timeit(@(...

casi 4 años ago | 0

Answered

Timing multiple Matlab functions

Hi, timing single calls within a program using tic/toc won't work, the resolution will simply be too coarse. What are you ...

Timing multiple Matlab functions

Hi, timing single calls within a program using tic/toc won't work, the resolution will simply be too coarse. What are you ...

casi 4 años ago | 1

| accepted

Answered

how to find max of 1000 values which are rows,i wrote a code it showed just one value and index that is not the max

Hi Shina, what exactly is the question: you think val is not the maximum of y? I don't see how this can happen ... Or are you...

how to find max of 1000 values which are rows,i wrote a code it showed just one value and index that is not the max

Hi Shina, what exactly is the question: you think val is not the maximum of y? I don't see how this can happen ... Or are you...

casi 4 años ago | 0

Answered

how to use datefind function?

Hi, use which datefind to find the file datefind.m in the finance toolbox. Copy it to your folder and name it "mydate...

how to use datefind function?

Hi, use which datefind to find the file datefind.m in the finance toolbox. Copy it to your folder and name it "mydate...

casi 4 años ago | 0

| accepted

Answered

textscan string reading data as string

Hi, you need to tell textscan, that a space (" ") doesn't split strings. Add this to the call of textscan: C = textscan(...

textscan string reading data as string

Hi, you need to tell textscan, that a space (" ") doesn't split strings. Add this to the call of textscan: C = textscan(...

casi 4 años ago | 1

| accepted

Answered

how to interface arduino uno with simulink?

Hi, for the first call you need to specify model and port, something like a = arduino('nano', 'COM3'); The informatio...

how to interface arduino uno with simulink?

Hi, for the first call you need to specify model and port, something like a = arduino('nano', 'COM3'); The informatio...

casi 4 años ago | 0

Answered

How to Create array with repeating values of another array

Hi David, use repmat and linear indexing: x = [1 2 3 4 5]; % repeat two times: xx = repmat(x, 2, 1); % and access all...

How to Create array with repeating values of another array

Hi David, use repmat and linear indexing: x = [1 2 3 4 5]; % repeat two times: xx = repmat(x, 2, 1); % and access all...

casi 4 años ago | 0

Answered

how to define a while statement that when the variable equals a numerical value, ends the code?

Hi, I understand the "get's value" is meant as "being not empty" ...? A = []; while isempty(A) % do something, ...

how to define a while statement that when the variable equals a numerical value, ends the code?

Hi, I understand the "get's value" is meant as "being not empty" ...? A = []; while isempty(A) % do something, ...

alrededor de 4 años ago | 0