Answered

Unable to perform assignment because the left and right sides have a different number of elements.

S = zeros(1,T/dt); S(1) = N; S is a vector. dS = ((-beta*(B/(B+k))*S(tt) + ub*(S(tt)+I(tt)+R(tt)) - ud*S) * dt)'; ...

Unable to perform assignment because the left and right sides have a different number of elements.

S = zeros(1,T/dt); S(1) = N; S is a vector. dS = ((-beta*(B/(B+k))*S(tt) + ub*(S(tt)+I(tt)+R(tt)) - ud*S) * dt)'; ...

8 días ago | 0

| accepted

Answered

How to find and store each spot center position in the loop.

Use bw = bwareafilt(imbinarize(croppedImage), [10 inf]); Some of your images end up with very small extra regions, jus...

How to find and store each spot center position in the loop.

Use bw = bwareafilt(imbinarize(croppedImage), [10 inf]); Some of your images end up with very small extra regions, jus...

8 días ago | 0

| accepted

Answered

Plot time series data colored by color coded by ID

t = readtable('YourFile.csv'); [G, ID] = findgroups(t{:,1}); hold on h = splitapply(@plot, t{:,2}, t{:,3}, G); xlim auto; yl...

Plot time series data colored by color coded by ID

t = readtable('YourFile.csv'); [G, ID] = findgroups(t{:,1}); hold on h = splitapply(@plot, t{:,2}, t{:,3}, G); xlim auto; yl...

8 días ago | 0

| accepted

Answered

Switching between functions that have the same name

You do not need to restoredefaultpath but you do need to remove the previous folder You do, however, need to clear the class. ...

Switching between functions that have the same name

You do not need to restoredefaultpath but you do need to remove the previous folder You do, however, need to clear the class. ...

8 días ago | 0

| accepted

Answered

How to stretch cos fit

axes([0 0.75 0.75 1.03]); %must do this before plot h(1) = scatter(xData, yData, 'b+', 'DisplayName', 'data'); hold on h(2)...

How to stretch cos fit

axes([0 0.75 0.75 1.03]); %must do this before plot h(1) = scatter(xData, yData, 'b+', 'DisplayName', 'data'); hold on h(2)...

8 días ago | 0

Answered

subplot for 'controlchart' function

Use the 'parent' option ax(1) = subplot(2,1,1); plot(ax(1), rand(1,20)); ax(2) = subplot(2,1,2); load parts st = contro...

subplot for 'controlchart' function

Use the 'parent' option ax(1) = subplot(2,1,1); plot(ax(1), rand(1,20)); ax(2) = subplot(2,1,2); load parts st = contro...

8 días ago | 1

| accepted

Answered

Why symvar() sort 10 smaller than 9

symvar() sorts inconsistently if I recall correctly. It gets complicated when you start mixing numbers and underscores. For the...

Why symvar() sort 10 smaller than 9

symvar() sorts inconsistently if I recall correctly. It gets complicated when you start mixing numbers and underscores. For the...

8 días ago | 0

| accepted

Answered

How to use else if with ODE45 solver?

The mathematics used in the RK methods such as ode45(), require that for any one call the function be continuous and its first t...

How to use else if with ODE45 solver?

The mathematics used in the RK methods such as ode45(), require that for any one call the function be continuous and its first t...

8 días ago | 0

Answered

How to avoid rounding error

A = [sym(10)^(-20) 1 ; 1 2] [L,U] = lu(A) L*U - A You can see from this that in order to get back A exactly, then you need a ...

How to avoid rounding error

A = [sym(10)^(-20) 1 ; 1 2] [L,U] = lu(A) L*U - A You can see from this that in order to get back A exactly, then you need a ...

8 días ago | 0

| accepted

Answered

How to achieve identical timing of two side by side annotations

For anything like this you should probably be using the third party Psychtoolbox http://psychtoolbox.org/

How to achieve identical timing of two side by side annotations

For anything like this you should probably be using the third party Psychtoolbox http://psychtoolbox.org/

8 días ago | 0

Answered

How to use movefile correct?

files = dir('/Users/haron/Desktop/Work/Haron/aprikose_edfs/*.edf.html'); for ii=1:length(files) oldname = fullfile(files(...

How to use movefile correct?

files = dir('/Users/haron/Desktop/Work/Haron/aprikose_edfs/*.edf.html'); for ii=1:length(files) oldname = fullfile(files(...

9 días ago | 0

| accepted

Answered

performing multiple elementwise operations at the same time

You would need the Parallel Computing Toolbox... and a flexible definition of "at the same time". It is unlikely to be worth th...

performing multiple elementwise operations at the same time

You would need the Parallel Computing Toolbox... and a flexible definition of "at the same time". It is unlikely to be worth th...

9 días ago | 0

Answered

what's the problem with my code ? Warning: Rank deficient, rank = 1, tol = 2.574115e-12.

for i = 1:n_pts+1 a = [X1 Y1]; Your X1 and Y1 do not change with the iterations, so your a will be the same for all iterations...

what's the problem with my code ? Warning: Rank deficient, rank = 1, tol = 2.574115e-12.

for i = 1:n_pts+1 a = [X1 Y1]; Your X1 and Y1 do not change with the iterations, so your a will be the same for all iterations...

9 días ago | 0

Answered

How to use #inlcude <>? # is declared as an invalid character!

MATLAB will not tell you that if your file extension is .c

How to use #inlcude <>? # is declared as an invalid character!

MATLAB will not tell you that if your file extension is .c

9 días ago | 2

| accepted

Answered

correlation between binary strings

R = sum((x - E).*(y - E)) ./ (sqrt(sum((x-E).^2)) .* sqrt(sum((y-E).^2)));

correlation between binary strings

R = sum((x - E).*(y - E)) ./ (sqrt(sum((x-E).^2)) .* sqrt(sum((y-E).^2)));

9 días ago | 0

Answered

Warning: Integer operands are required for colon operator when used as index.

If length(V2) is even, then length(V2)-1 is odd, and length(V2)-1)/2 would not be an integer when you do the 0:1: operation. Lik...

Warning: Integer operands are required for colon operator when used as index.

If length(V2) is even, then length(V2)-1 is odd, and length(V2)-1)/2 would not be an integer when you do the 0:1: operation. Lik...

9 días ago | 0

Answered

Need help to mask the image.

img = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/578172/untitled.jpg'); grimg = rgb2gray(img); bla...

Need help to mask the image.

img = imread('https://www.mathworks.com/matlabcentral/answers/uploaded_files/578172/untitled.jpg'); grimg = rgb2gray(img); bla...

9 días ago | 0

Answered

Use the input arguments to load user-defined .mat files(2xn matrix) in the function.

A= load (varargin{1}); %to load first inputargument file name This assumes that when you called [Ans1,Ans2,Ans3,Ans4]= Data_fu...

Use the input arguments to load user-defined .mat files(2xn matrix) in the function.

A= load (varargin{1}); %to load first inputargument file name This assumes that when you called [Ans1,Ans2,Ans3,Ans4]= Data_fu...

9 días ago | 1

| accepted

Answered

Calling Matlab from command line gives Caught unexpected exception of unknown type, why?

clear all; clear all asks MATLAB to destroy as much state as possible, leaving little more than what is stored in the current g...

Calling Matlab from command line gives Caught unexpected exception of unknown type, why?

clear all; clear all asks MATLAB to destroy as much state as possible, leaving little more than what is stored in the current g...

9 días ago | 0

Answered

screen size should not be effected by the resolution

The changes to MATLAB to make it less dependent on screen resolution, are not active until a certain minimum resolution, so if t...

screen size should not be effected by the resolution

The changes to MATLAB to make it less dependent on screen resolution, are not active until a certain minimum resolution, so if t...

9 días ago | 0

Answered

Fprintf values in an ordered manner

x=[0.1,5,10] y=[400,500,600] fprintf('%-10g %-10f\n',[x(:),y(:)].')

Fprintf values in an ordered manner

x=[0.1,5,10] y=[400,500,600] fprintf('%-10g %-10f\n',[x(:),y(:)].')

9 días ago | 0

| accepted

Answered

How to cluster 1D array so that approximately equal values are replaced by their average?

https://www.mathworks.com/help/matlab/ref/uniquetol.html [~, ~, G] = uniquetol(xx); xxmean = grpstats(xx, G, 'mean');

How to cluster 1D array so that approximately equal values are replaced by their average?

https://www.mathworks.com/help/matlab/ref/uniquetol.html [~, ~, G] = uniquetol(xx); xxmean = grpstats(xx, G, 'mean');

9 días ago | 1

| accepted

Answered

Why do I keep getting this error message?

no, im trying to solve for T , and equal it with -20*dx Generally speaking, there are three situations: in one case, the left ...

Why do I keep getting this error message?

no, im trying to solve for T , and equal it with -20*dx Generally speaking, there are three situations: in one case, the left ...

9 días ago | 0

Answered

Empty sym: 0-by-1

There is no solution to those equations. m2 = rand() * 10; m3 = rand() * 10; m4 = rand() * 10; ag2x = randn() * 10; ag3x = ...

Empty sym: 0-by-1

There is no solution to those equations. m2 = rand() * 10; m3 = rand() * 10; m4 = rand() * 10; ag2x = randn() * 10; ag3x = ...

9 días ago | 0

| accepted

Answered

How do I make accurately proportioned axes?

You could linkprop the axes DataAspectRatio property, if it is a matter of getting the units to have the same ratios . However ...

How do I make accurately proportioned axes?

You could linkprop the axes DataAspectRatio property, if it is a matter of getting the units to have the same ratios . However ...

9 días ago | 0

Answered

How to combine function in simulink

https://www.mathworks.com/help/simulink/ug/select-subsystem-execution.html Use the time as input to an If Action Subsystem

How to combine function in simulink

https://www.mathworks.com/help/simulink/ug/select-subsystem-execution.html Use the time as input to an If Action Subsystem

9 días ago | 0

| accepted

Answered

sir, while executing the below code i am getting undefined variable or the function . i tried it it but i didnt get the correct way to slolve . plz help me int his

Your loop over k did not have any iterations. Perhaps you told it to look for files in the wrong folder.

sir, while executing the below code i am getting undefined variable or the function . i tried it it but i didnt get the correct way to slolve . plz help me int his

Your loop over k did not have any iterations. Perhaps you told it to look for files in the wrong folder.

10 días ago | 0

| accepted

Answered

if x is a variable, solve for x

If the user inputs a variable name for exactly one of the prompts, then symvar(equation) will tell you which variable it was. s...

if x is a variable, solve for x

If the user inputs a variable name for exactly one of the prompts, then symvar(equation) will tell you which variable it was. s...

10 días ago | 1

| accepted

Answered

Getting all Permutations of a 18+ integer vector

I posted code at https://www.mathworks.com/matlabcentral/answers/623358-get-a-combination-of-unique-paths-for-given-pair-of-numb...

Getting all Permutations of a 18+ integer vector

I posted code at https://www.mathworks.com/matlabcentral/answers/623358-get-a-combination-of-unique-paths-for-given-pair-of-numb...

10 días ago | 1

Answered

How to generate data from Function and save in CSV in MatLab?

n = 20; x_i = rand(1,n); f11 = @(x) exp(-mean(x.^2)); y_i = f11(x_i) dlmwrite('test.csv', y_i)

How to generate data from Function and save in CSV in MatLab?

n = 20; x_i = rand(1,n); f11 = @(x) exp(-mean(x.^2)); y_i = f11(x_i) dlmwrite('test.csv', y_i)

10 días ago | 0