44,340 total contributions since 2011

I do not do free private consulting. If you want to bring my attention to something, send a link to the MATLAB Answers location.

Answered

How can I change the lamp color while the application is running?

Use drawnow() to give MATLAB a chance to update the screen.

How can I change the lamp color while the application is running?

Use drawnow() to give MATLAB a chance to update the screen.

13 hours ago | 0

| accepted

Answered

Code running, but not being displayed in command window?

You have function F=q4(x) % System of non-linear equations F(1) = x(1)^2+x(2)^2-26; F(2) = 3*x(1)^2+25*x(2)^2-100; %part b ...

Code running, but not being displayed in command window?

You have function F=q4(x) % System of non-linear equations F(1) = x(1)^2+x(2)^2-26; F(2) = 3*x(1)^2+25*x(2)^2-100; %part b ...

13 hours ago | 0

Answered

work with numbers in number

x = 40.201109; xs = sprintf('%.6f', x); a = str2double(xs(1:2)); b = str2double(xs(end-3:end-1)); c = str2double(xs(end-2:en...

work with numbers in number

x = 40.201109; xs = sprintf('%.6f', x); a = str2double(xs(1:2)); b = str2double(xs(end-3:end-1)); c = str2double(xs(end-2:en...

14 hours ago | 0

Answered

Solving a cubic function to get one numeric result?

S = solve(eqn,V,'Real',true,'MaxDegree',3) and sols = solve(a*x^3 - b*x^2 + c*x - d, x) and p = [1 -0.10933127 0.00082152 -0...

Solving a cubic function to get one numeric result?

S = solve(eqn,V,'Real',true,'MaxDegree',3) and sols = solve(a*x^3 - b*x^2 + c*x - d, x) and p = [1 -0.10933127 0.00082152 -0...

14 hours ago | 0

| accepted

Answered

Error using ones Size inputs must be integers?

If you want an image the same size as img2 then r = zeros(size(img2), class(img2)); after which you can assign ones into an ap...

Error using ones Size inputs must be integers?

If you want an image the same size as img2 then r = zeros(size(img2), class(img2)); after which you can assign ones into an ap...

14 hours ago | 0

Answered

Display real time data in GUI.

Variables are only global inside of functions that declare them to be global. You can never force a variable to be global everyw...

Display real time data in GUI.

Variables are only global inside of functions that declare them to be global. You can never force a variable to be global everyw...

18 hours ago | 0

| accepted

Answered

Create array tm and Tm corresponding to the midpoints of t and T Temperature steps

tm = t(1:end-1) + delt/2 where delt is the vector we discussed in your previous Question.

Create array tm and Tm corresponding to the midpoints of t and T Temperature steps

tm = t(1:end-1) + delt/2 where delt is the vector we discussed in your previous Question.

18 hours ago | 0

Answered

To do arithmetic operations with large arrays going out of memory space

It is not possible to tell MATLAB to store variables on disk, at least not in the way you are describing. You can tell your sys...

To do arithmetic operations with large arrays going out of memory space

It is not possible to tell MATLAB to store variables on disk, at least not in the way you are describing. You can tell your sys...

18 hours ago | 0

Answered

Need to find the local maxima and minima of a cubic function, then write an iterating function.

for j = 0.001:10.1 j increments by 1 else j = j+.001 You are trying to modify the loop control variable. That is legal...

Need to find the local maxima and minima of a cubic function, then write an iterating function.

for j = 0.001:10.1 j increments by 1 else j = j+.001 You are trying to modify the loop control variable. That is legal...

18 hours ago | 0

Answered

fprintf multiple outputs separately

still_in_game = true(1, number_of_players); while any(still_in_game) for player_number = find(still_in_game) %if di...

fprintf multiple outputs separately

still_in_game = true(1, number_of_players); while any(still_in_game) for player_number = find(still_in_game) %if di...

23 hours ago | 1

| accepted

Answered

Extract eigenvalues and eigenvectors / Symbolic to numeric / Rayleigh-Ritz Method / Vibro-acoustics

https://www.mathworks.com/help/symbolic/eig.html Symbolic eigenvalue does not support generalized eigenvalues.

Extract eigenvalues and eigenvectors / Symbolic to numeric / Rayleigh-Ritz Method / Vibro-acoustics

https://www.mathworks.com/help/symbolic/eig.html Symbolic eigenvalue does not support generalized eigenvalues.

1 day ago | 0

Answered

combination of integer numbers

[Ag, Bg, Cg, Dg] = ndgrid(0:15); Eg = [Ag(:), Bg(:), Cg(:), Dg(:)]; mask = sum(Eg,2) == 15; selected = Eg(mask,:); a = selec...

combination of integer numbers

[Ag, Bg, Cg, Dg] = ndgrid(0:15); Eg = [Ag(:), Bg(:), Cg(:), Dg(:)]; mask = sum(Eg,2) == 15; selected = Eg(mask,:); a = selec...

1 day ago | 0

Answered

MATLAB file to C compiler Command changes\ Makefile from MATLAB code

MATLAB Coder does not support graphics, except some of the Computer Vision routines to "draw" into arrays, and some specialized ...

MATLAB file to C compiler Command changes\ Makefile from MATLAB code

MATLAB Coder does not support graphics, except some of the Computer Vision routines to "draw" into arrays, and some specialized ...

1 day ago | 0

Answered

Conditional calculations on a numeric matrix

mask = input > thresholdvalue; result(mask) = input(mask) * 2; result(~mask) = input(mask) / 2;

Conditional calculations on a numeric matrix

mask = input > thresholdvalue; result(mask) = input(mask) * 2; result(~mask) = input(mask) / 2;

1 day ago | 0

| accepted

Answered

Preprocessing using readtable()

Use detectImportOptions() on the csv file, and store the result to a variable. Now modify the DataLines property of the import o...

Preprocessing using readtable()

Use detectImportOptions() on the csv file, and store the result to a variable. Now modify the DataLines property of the import o...

1 day ago | 0

Answered

How to convert a variable which has binary data in .mat format to .txt?

save() with the -ascii -double options is one way. However, if I recall, this can lose the last bit or two of precision, so if y...

How to convert a variable which has binary data in .mat format to .txt?

save() with the -ascii -double options is one way. However, if I recall, this can lose the last bit or two of precision, so if y...

1 day ago | 0

Answered

please help me with this

You have F=[]; inside the loop, so you are throwing away all of the F contents except for the last image.

please help me with this

You have F=[]; inside the loop, so you are throwing away all of the F contents except for the last image.

1 day ago | 0

Answered

Simple Message Encryption with Matricies

>> mod(F(1,:),1) ans = 4.2632564145606e-14 0 0.999999999999943 char() truncates ra...

Simple Message Encryption with Matricies

>> mod(F(1,:),1) ans = 4.2632564145606e-14 0 0.999999999999943 char() truncates ra...

1 day ago | 0

| accepted

Answered

Chaotic map, Metaheuristic

The number of sequences is equal to the number number of values representable in the data type you are using, raised to the powe...

Chaotic map, Metaheuristic

The number of sequences is equal to the number number of values representable in the data type you are using, raised to the powe...

2 days ago | 0

Answered

defined n with the equation

"Create as the midstep values are computed" is talking about a for loop with controlling variable n, and for n=2 onwards you cal...

defined n with the equation

"Create as the midstep values are computed" is talking about a for loop with controlling variable n, and for n=2 onwards you cal...

2 days ago | 0

Answered

Real Time audio modification and reproduction trough GUI

You cannot do that for audioplayer objects. In current releases you would use the Audio System Toolbox. In your release yo...

Real Time audio modification and reproduction trough GUI

You cannot do that for audioplayer objects. In current releases you would use the Audio System Toolbox. In your release yo...

2 days ago | 0

Answered

any trick to stop fminsearch early?

fminsearch permits options that include Outputfcn and that function can signal to terminate.

any trick to stop fminsearch early?

fminsearch permits options that include Outputfcn and that function can signal to terminate.

3 days ago | 1

Answered

Hot to locate indices of 2-D data located out of circle?

vector_of_y_values = (1:number_of_rows) - y_center; vector_of_x_values = (1:number_of_columns) - x_center; [Yg, Xg] = ndgrid(v...

Hot to locate indices of 2-D data located out of circle?

vector_of_y_values = (1:number_of_rows) - y_center; vector_of_x_values = (1:number_of_columns) - x_center; [Yg, Xg] = ndgrid(v...

3 days ago | 0

| accepted

Answered

Guide math operation equal.

You need to parse what is in get(handles.text1,'string') . If it is not (optional spaces followed by) = (followed by optional ...

Guide math operation equal.

You need to parse what is in get(handles.text1,'string') . If it is not (optional spaces followed by) = (followed by optional ...

3 days ago | 0

| accepted

Answered

How do I get MATLAB to use first set of data from csv Excel sheet I have?

csvread() cannot handle text, except that you can tell it to skip leading rows and/or leading columns. So you can tell csvread()...

How do I get MATLAB to use first set of data from csv Excel sheet I have?

csvread() cannot handle text, except that you can tell it to skip leading rows and/or leading columns. So you can tell csvread()...

3 days ago | 1

| accepted

Answered

Why it said that "Matrix index is out of range for deletion"

Strin=strcat(strFirst,"_",strLast); Because you used "_" the result you get is going to be a string object, not a character vec...

Why it said that "Matrix index is out of range for deletion"

Strin=strcat(strFirst,"_",strLast); Because you used "_" the result you get is going to be a string object, not a character vec...

3 days ago | 0

Answered

My Matlab recently told me to update my version. How is this done?

In the command window, on the upper right, click on RESOURCES . Click on Help there. One of the menu items that comes up will th...

My Matlab recently told me to update my version. How is this done?

In the command window, on the upper right, click on RESOURCES . Click on Help there. One of the menu items that comes up will th...

3 days ago | 1

| accepted

Answered

How to frequently run ODE45?

for T = 300:100:1000 [z,y] = ode23s(@(t,y) equations(t,y,T), [0 1], [0 0 0 1]); rco2 = desparameter(1e-20,T,80 * 1.660...

How to frequently run ODE45?

for T = 300:100:1000 [z,y] = ode23s(@(t,y) equations(t,y,T), [0 1], [0 0 0 1]); rco2 = desparameter(1e-20,T,80 * 1.660...

3 days ago | 0

| accepted