Réponse apportée
Why I'm getting this error( Array indices must be positive integers or logical values)?
When I run your code, it stops with the error, the w is undefined in the line: w(n+1) = w(n)+(2*0.01*e*[x(n),x(n+1),x(n+2)])% ...

environ 3 ans il y a | 0

Réponse apportée
How to get around using pack function in matlab 2022b?
The pack command is not useful anymore. Try to comment it out in the code. Asking the author is a good option also.

environ 3 ans il y a | 0

| A accepté

Réponse apportée
Invalid use of operator
The old problem: Strange methods to define names of variables dynamically using eval() demands for even stranger methods to acce...

environ 3 ans il y a | 0

Réponse apportée
How to check that these points formulate flat plane(on the same plane)?
P1 = [396326796.725069,-205153846.153846,0,0,0,0]; P2 = [-205153846.153846,396326796.725069,-205153846.153846,0,0,0]; P3 = [0,...

environ 3 ans il y a | 1

Réponse apportée
Monod nonlinear regression solved with Ode45
A guess: You call the function ParameterJack with 2 inputs: w=ParameterJack(ps,t); But the function requires 5: function dCdt...

environ 3 ans il y a | 0

Réponse apportée
How to plot a variable increasing in a for loop
If the plot should be expanded in each iteration, move the plot command inside the loop: axes('NextPlot', 'add'); % As hold('o...

environ 3 ans il y a | 0

Réponse apportée
How I can rotate cube the way that front plane will be come the top plane?
Use permute(planes, [2,1,3]) to move the 3D coordinates to the first dimension. Move the center of the body to the origin (or t...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
Style in Matlab functions
I use the upper/lower case of the default setting: h = figure; set(h) The documentation explains, that the names and values a...

environ 3 ans il y a | 0

Réponse apportée
Arrays have incompatible sizes for this operation.
If you use a normal function instead of an anonymous function, you can use the debugger easily. function y = funy(r,theta,phi) ...

environ 3 ans il y a | 0

Réponse apportée
I keep getting "Error using / Arguments must be numeric, char, or logical. " in bayesopt.
Anonymous functions are compact, but less useful for debugging. Use a normal function instead: fxc = @yourFcn; xvar = optimiz...

environ 3 ans il y a | 0

Réponse apportée
How to add values in coloumn with corresponding of logical array?
Start from the end: s = 0; for k = size(Event, 1):-1:1 if Event(k, 10) % You can omit the == 1 s = s + Event(k,...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
Error using horzcat Dimensions of arrays.
num2str(x) replies a CHAR matrix, if x contains several rows: a = num2str(rand(2)) You cannot concatenate a CHAR vector and a ...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
Solving a differential equation using ode45
θ'' - µ*θ'^2 + (g/r)*(µ*cos(θ) - sin(θ)) = 0 means: θ'' = µ*θ'^2 - (g/r)*(µ*cos(θ) - sin(θ)) This does not match: g(2,1) = -...

environ 3 ans il y a | 1

Réponse apportée
Set 2 structure fields to be the same result when 1 is a function call within a structure element
You can use memoize or a simple tool like here: https://www.mathworks.com/matlabcentral/answers/1892960-memoize-save-restore-cac...

environ 3 ans il y a | 0

Réponse apportée
Round values to specific number
The colon operator creates a vector from the 1st argument in steps of the 2nd argument until the 3rd argument, but it does not i...

environ 3 ans il y a | 0

Réponse apportée
Opposite command of strfind?
No, strfind does not replie true for any inputs. It replies the indices of found matchs. Maybe you mean: a = "Milano"; b = "M...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
Error Using *. Matrix Dimensions Must Agree
The error message is clear: The dimension of the operators do not match. We cannot run your code (posted as screenshot unfortuna...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
After set the path of "mosek", the files still can't work. (macOS)
Obviously the step "when i add the path to MATLAB" is not successful. So please post, how you do this. Remember that the path i...

environ 3 ans il y a | 0

Réponse apportée
Compiled code to use str2func to call an application (mlapp file) fails while the same code works in the MATLAB environment
A bold guess: Is HBCPlot() included in the compiled application? If its name is hidden, Matlab cannot guess, that it has to be i...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
short way to bar plot a discretize vector?
A = rand(1, 100); edges = linspace(0, 1, 6); dsc = discretize(A, edges); result = accumarray(dsc(:), A(:)); % Default ...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
String convertion to date
a = '16deNoviembredel2017'; b = '20:56:14'; dt_event = datetime([a,b], 'Locale', 'es_ES', ... 'InputFormat', 'dd''de''MMM...

environ 3 ans il y a | 2

| A accepté

Réponse apportée
Output of values via a callback function
Callbacks do not have an output. Store obtained data in the UserData or ApplicationData of the calling object.

environ 3 ans il y a | 1

| A accepté

Réponse apportée
I have been trying to fix the problem of this code but unfortunately It keep saying ERORR on line 71 which is [y= dfl(xo)\fl(xo)]. Need to help?
"Unrecognized function or variable 'dfl'." - The error message seems to be clear: The expression "dfl" is unknown. Do you expect...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
How to compile .mex from folders path?
@Gundeep: Prefer using absolute paths. If e.g. the folder "mexFunctions" is in the current folder, use: addpath(fullfile(cd, 'm...

environ 3 ans il y a | 0

| A accepté

Réponse apportée
Out of memory error in Matlab and How to solve it?
Of course an out-of-memory problem is solved, if more RAM is available. But if the equation is stiff, this solution is of tempor...

environ 3 ans il y a | 0

Réponse apportée
convert 1x20 double struct into a vector containing 20 values
With wild guessing: S.y = rand(1, 20); % Is this equivalent to your struct? plot(S.y); % Is this the way your get a ...

environ 3 ans il y a | 0

Réponse apportée
load a large text file and split it after a specific character
S = readlines('YourFile.txt'); ind = [find(startsWith(S, '$')); numel(S) + 1]; % [EDITED, readlines reply column vector] n ...

environ 3 ans il y a | 0

Réponse apportée
How to break data in to groups using while loop?
matrix = [1 50 60 70 50 40; ... 2 NaN 10 20 10 10; ... 3 NaN 20 NaN NaN NaN; ... 1 NaN 60 30 40...

environ 3 ans il y a | 0

Réponse apportée
Attempt to grow array along ambiguous dimension. it happens when N,M are smaller then the total of A,B. can I make my code work for any value of N,M? if so how would I do that
Some simplifications: Use numel(C) instead of length(C(:)). C(1:end) is exactly the same as C. The values to not matter the ...

environ 3 ans il y a | 1

Réponse apportée
my code keeps looping indefinitely and I could not figure out why, please help
No, the loops do run run infinitely. They are only slow. Check this with displaying a loop counter. Use the profile to find the...

environ 3 ans il y a | 0

| A accepté

Charger plus