답변 있음
Syntax for optimization with integer and continuous variables, nonlinear equalities and inequalities?
You only have 2^5=32 possible combinations of values for the integer variables x. The best thing to do would be to loop over the...

2년 초과 전 | 1

답변 있음
Can you change 0^0=1 to 0^0=0 in Matlab?
No, you cannot. Well, actually, you could create your own subclass of type double (or other numeric types) and overload the pow...

2년 초과 전 | 0

| 수락됨

답변 있음
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

2년 초과 전 | 0

답변 있음
Can you change 0^0=1 to 0^0=0 in Matlab?
No, you cannot.

2년 초과 전 | 1

답변 있음
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) ...

2년 초과 전 | 0

답변 있음
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...

2년 초과 전 | 0

답변 있음
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...

2년 초과 전 | 0

| 수락됨

답변 있음
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...

2년 초과 전 | 0

| 수락됨

답변 있음
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 ...

2년 초과 전 | 0

| 수락됨

답변 있음
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...

2년 초과 전 | 0

질문


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...

2년 초과 전 | 답변 수: 2 | 2

2

답변

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

2년 초과 전 | 0

| 수락됨

답변 있음
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...

2년 초과 전 | 0

답변 있음
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(:)'

2년 초과 전 | 3

답변 있음
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)

2년 초과 전 | 1

답변 있음
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...

2년 초과 전 | 0

| 수락됨

답변 있음
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...

2년 초과 전 | 0

답변 있음
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...

2년 초과 전 | 0

답변 있음
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);

2년 초과 전 | 0

답변 있음
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...

2년 초과 전 | 0

| 수락됨

답변 있음
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...

2년 초과 전 | 2

답변 있음
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...

2년 초과 전 | 3

| 수락됨

답변 있음
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)

2년 초과 전 | 0

| 수락됨

답변 있음
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;...

2년 초과 전 | 0

| 수락됨

답변 있음
groupcounts and sum of data in another array in the same order
accumarray(findgroups(A(:)), B(:))

2년 초과 전 | 0

답변 있음
groupcounts and sum of data in another array in the same order
splitapply(@sum,B,findgroups(A))

2년 초과 전 | 0

답변 있음
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.

2년 초과 전 | 0

답변 있음
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 ...

2년 초과 전 | 0

답변 있음
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 ...

2년 초과 전 | 0

| 수락됨

더 보기