Answered
lsqnonlin with multiple start vectors: continue with next start vector if the function computing the objective function sets a "flag"
Use error() to cause lsqnonlin to abort. You might need try/catch to contain the error.

3 years ago | 0

| accepted

Answered
How to plot a derivative against variable?
Change t = (0.0:0.001:5); to syms t Change plot(t,x,'b') to fplot(x, [0 5]) change plot(t, ...

3 years ago | 0

| accepted

Answered
Get user input on string, ideally using uicontrol?
See https://www.mathworks.com/help/matlab/ref/inputdlg.html and in particular the default input option. [filename, pathname] = ...

3 years ago | 0

| accepted

Answered
How to implement the following algorithm in MATLAB ?
sr = [1 1 1 1 2 2 2 2 3 3 4 5 5 5 5 6 6 6 6 6]; % various possible sources ta = [2 6 7 8 3 7 5 8 4 8 8 4 3 7 8 5 4 7 3 8]; % va...

3 years ago | 0

| accepted

Answered
Solving a set of 8 non-linear equations using symbolic toolbox results in empty sym 0 by 1
% 8 knowns that are real syms Lx Ly Mx My Nx Ny Ox Oy assume ([Lx Ly Mx My Nx Ny Ox Oy], 'Real') % 8 unknowns that are real...

3 years ago | 0

| accepted

Answered
What is the difference between statistical and machine learning methods when it comes to apply them for prediction given a set of observations?
The Machine Learning process proceeds by generating random weights, improving the fitting starting from those random weights, th...

3 years ago | 0

Answered
how to save data of lots of images individually?
https://www.mathworks.com/help/matlab/cell-arrays.html Initialize a cell array the size of the number of images in the folder....

3 years ago | 0

Answered
How to use Matlab for K-Nearest Neighbor (KNN) to predict the real estate prices given a set of observation?
When you use knnsearch use 'seuclidean' distance, and use the 'Scale' option to give a higher weight to the price column .

3 years ago | 1

Answered
How to use Matlab for Support Vector Machine (SVM) to predict the real estate prices given a set of observations?
I think that would be tricky. SVM is used for classification not for prediction. You could potentially create classes for each...

3 years ago | 1

Answered
How do I make two variables the same number for conditions in a if=else statement?
MATLAB does not distribute tests, except sometimes in the symbolic toolbox. a && b == 0 is treated as (a) && (b == 0) wh...

3 years ago | 0

Answered
Why do I get an output for each digit rather than the whole number?
You used the 's' option in your input() call reading in weight . When you use 's' option the result is a character vector of wha...

3 years ago | 1

| accepted

Answered
Symbolic acos( cos(theta) ) does not return theta.
syms theta real assume( theta >-1 & theta < 1) a = simplify( acos(cos(theta)) ) fplot(a, [-1 1]) If the identity holds then ...

3 years ago | 0

| accepted

Answered
Why do I receive Warning: Marker input is ignored?
'.' is a marker style not a line style. yline ignores markers https://www.mathworks.com/help/matlab/ref/yline.html#mw_90060888-...

3 years ago | 0

Answered
Passing variable from MatLab workspace as a keyword and value input argument of pyrunfile().
[pyData1] = pyrunfile(pyfile, [varNamesOut], pyDataIn = matlabDataOut) MATLAB converts that into [pyData1] = pyrunfile...

3 years ago | 0

| accepted

Answered
Applying a mask to 3D Data
Your fw is 128 by 128 by 72 which is 1179648 elements. Your mask is 186456 x 1. That is less than 1/6th of the size of fw. Are...

3 years ago | 0

Answered
Simulink "Invalid cross-device link (18)" - error
You need to update to the newest R2022b. This is a known problem that was fixed in one of the updates.

3 years ago | 0

| accepted

Answered
curve fitting of two equation to two data sets simultaneously
Calculus and least-squared residues: format long g rng(655321) x = -10:10; %change as appropriate G1 = sort(rand(size(x)))...

3 years ago | 0

Answered
Error in creating model using COMSOL with MATLAB
https://www.comsol.de/forum/thread/227272/run-comsol-from-matlab (Lars posted there: You should load the model using model = ...

3 years ago | 0

| accepted

Answered
Goodness of fit for a Zipf distribution
The zeta() function is 0 for all even negative integers, so zeta(rho+1) is 0 for all odd negative integers smaller than -1. You ...

3 years ago | 0

Answered
The training images are of size 224×224×3 but the input layer expects images of size 224×224×1.
https://www.mathworks.com/help/deeplearning/ref/augmentedimagedatastore.html Use an augmentedImageDataStore with size 224 224 ...

3 years ago | 0

Answered
'String scalar or character vector must have valid interpreter syntax' in waitbar
Not directly, but just after you create your waitbar, like wb = waitbar(0, 'File Name Will Go Here'); you can wb.Children(1)....

3 years ago | 1

| accepted

Answered
How to find the minimum of a multivariable vector function in MATLAB?
If you have an anonymous function that creates a vector of values, and you want to optimize one of the elements, then you have a...

3 years ago | 0

Answered
Server configuration for MATLAB
Parallel Server https://www.mathworks.com/products/matlab-parallel-server.html (formerly called Distributed Computing) is one po...

3 years ago | 0

| accepted

Answered
how i can manage the cos error
I do not see any cos error, but I had to guess that pie(3.2) means times 3.2 tan(pi*(3.2)-7-(cos(5/77)^-3/2)^2.1-cot(5.2e-5/8)...

3 years ago | 0

Answered
I have troubles in understanding how could I turn some data type sym variables into data type symfun, can anybody make it clear for me?
ytangent(x) = -42*x+1/42 %Solve the Equation of the normal line ynormal(x) = 1/42*x+215/42

3 years ago | 0

Answered
How to confirm the connection when using MATLAB Online and PC client cooperation?
"Is there a command that can confirm the connection is connected?" NO. MATLAB Online executes in the cloud, and the user i...

3 years ago | 1

Answered
add error for when input is not integer
~isnumeric(value) || mod(value, 1) ~= 0

3 years ago | 0

Answered
How to Search Blank Line ?
Assuming a cell array line_is_blank = cellfun(@(S)isempty(strtrim(S)), YourCellArray)

3 years ago | 1

Answered
Adding DataTipRows - I can't set VALUE of new DataTipRows
The 'value' (second parameter) to dataTipTextRow must be character vector | string scalar | vector | function handle . You can...

3 years ago | 0

Answered
Using the diff command and solve command
f=@(x,y) 2*x^3*y - y^2 - 3*x*y; syms x y; G = [diff(f,x); diff(f, y)]; sol = solve(G, [x y]) subs([x, y], sol)

3 years ago | 0

Load more