Answered
Add a properties block to the class definition file course.m and define properties called Name, Level, and Waypoints.
There is no error. But the code you've shown was to be placed in a file called course.m

3 years ago | 0

Answered
Can you change 0^0=1 to 0^0=0 in Matlab?
No, you cannot.

3 years ago | 1

Answered
How to calculate the highest degree term with its coefficient in this expression with respect to t?
syms t x; expression = ((49*t^2 - 82600*t + 35060000)^(1/2)/550)*x; p=sym2poly((expression*550/x)^2) degree=numel(p) ...

3 years ago | 0

Answered
How can I reduce the run time a code?
Replace the whole for-loop over y with, index_control=ismember(aktivite1, aktivite2); m=find(index_control,1); index_cont...

3 years ago | 0

Answered
Vectorized generation of a cell
There is no way to create or manipulate cells without for-loops. Things like mat2cell, num2cell, etc... all have for-loops insid...

3 years ago | 0

| accepted

Answered
NonLinear Constraint not verified, although fmincon says it is
For the sqp algorithm, the ConstraintTolerance is relative, not absolute. See the table here, https://www.mathworks.com/help/op...

3 years ago | 0

| accepted

Answered
how to use getvarname
PtnBaseSA2 is an arraycell with many elements. I find the word "PtnBaseSA2" in some text and display some array indices of this ...

3 years ago | 0

| accepted

Answered
How to combine argument validation with varargin
This is one solution, but is very inconvenient, because it requires that I offload the argument checking to another function, ch...

3 years ago | 0

Question


How to combine argument validation with varargin
How can I make varargin work in conjunction with an arguments block? In the function below, the first two inputs W and p have ve...

3 years ago | 2 answers | 2

2

answers

Answered
display cell array vertically
Perhaps this is what you want, W1={{1,2},{3,4}} W2=reshape([W1{:}],2,[])'

3 years ago | 0

| accepted

Answered
Only plot outline of graph
Use movmax to get the upper envelope of a sequence of data points, and possibly smooth it with sgolayfilt, e.g., % Numerical da...

3 years ago | 0

Answered
Quickest way for alternate indexing a vector
n=9;c=[4;2]; s=c(1)+c(2); c(2)=s; u= 1 + c + (0:s:s*(n-1)); u=u(:)'

3 years ago | 3

Answered
Quickest way for alternate indexing a vector
n=9;c=[4;2]; s=c(1)+c(2); clear u u(2:2:2*n)=1+s:s:s*n+1; u(1:2:2*n)=u(2:2:2*n)-c(2)

3 years ago | 1

Answered
Is it possible to subsample an image by deleting data then interpolating to create a blurred image, while keeping the resulting image the same size as the original image?
siz=size(originalImage); tempImage=originalImage( 1:subsamplingFactor:end, 1:subsamplingFactor:end, :); blurredImage = im...

3 years ago | 0

| accepted

Answered
why putting a variable in a matrix divide it?
It is a 2x2 matrix, even though you might not like how it gets rendered in the Command Window. If it were not really a 2x2 matri...

3 years ago | 0

Answered
Two functions optimization and curve fitting
Either you have a bad initial guess, or a bad model. If the latter is true, we cannot help you. If the former is true, it may he...

3 years ago | 0

Answered
How to replace elements of one dimension of an n-D matrix based on values in the same dimension of another n-D matrix of equal dimensions?
Possible? Yes. Advisable? Not so sure. x(:,1,:)=x(:,1,:).*(y(:,1,:) ~= 1) + 99*(y(:,1,:) == 1);

3 years ago | 0

Answered
Estimate different trend lines and its slopes from a set of points
This FEX download, https://www.mathworks.com/matlabcentral/fileexchange/25872-free-knot-spline-approximation?s_tid=ta_fx_result...

3 years ago | 0

| accepted

Answered
I have to optimise an objective function within defined limits
You can set any nonlinear constraint functions that you want, though ideally it would be continuously differentiable. However, b...

3 years ago | 2

Answered
Fill a specific region of fcontour without generating a mesh
Using the FEX download getContourLineCoordinates, fun=@(x,y)x.^2+y.^2-1; M=fcontour(fun,[-pi pi -pi pi],'LevelList',[0,1,2...

3 years ago | 3

| accepted

Answered
How do you convert the left picture (a) into the right picture (b) using image processing toolbox?
[R,G,B]=imsplit(imread('Image.png')); BW=imfill( bwareaopen(R>130 & G>130 & B>110,10) ,'holes'); imshow(~BW)

3 years ago | 0

| accepted

Answered
Optimizing a matrix of values
You could define the whole matrix as unknown, but with diagonal elements bound to zero: LB=-inf(n); LB(1:n+1:end)=0; UB=-LB;...

3 years ago | 0

| accepted

Answered
groupcounts and sum of data in another array in the same order
accumarray(findgroups(A(:)), B(:))

3 years ago | 0

Answered
groupcounts and sum of data in another array in the same order
splitapply(@sum,B,findgroups(A))

3 years ago | 0

Answered
How to find the optimum number of neurons and hidden layers for ANN?
By trial and error, though you can automate some of that using the Experiment Manager.

3 years ago | 0

Answered
how to enlarge ROI around its boundary?
Isn't there something available that operates directly on the position data of Matlab ROI objects...? You can make a polyshape ...

3 years ago | 0

Answered
Trying to use function ,didnt work?
when i typed it like this it gave me error I doubt it gave you an error. It certainly doesn't give me one. You probably got a ...

3 years ago | 0

| accepted

Answered
How to use least-square fit and gaussian surface for 3D data?
This FEX file will fit a Gaussian with a constant background in any dimension, https://www.mathworks.com/matlabcentral/fileexch...

3 years ago | 1

Answered
Input multiple region for polyshape
There is no unique way to divide a series of points into closed polygons. If you haven't inserted the NaNs already, the intended...

3 years ago | 0

Load more