답변 있음
Error in plotting - indices not compatible
vpasolve is returning empty (because it found no solution), so you cannot assign it to soly3(1) >> vpasolve(subs(N1_subs_tsol3/...

2년 초과 전 | 0

답변 있음
how does fmincon deal with ill-conditioned problem?
It depends how badly conditioned your objective is. Most fmincon algorithms are some variation of Newton's method, which helps a...

2년 초과 전 | 0

답변 있음
transform the number cell so that only numbers (with or without decimals) excluding zeros are visible
You can round all of the numbers to 2 decimal places as below. This will make it so that any number that was an integer to 2 dec...

2년 초과 전 | 0

답변 있음
transform the number cell so that only numbers (with or without decimals) excluding zeros are visible
If your're just looking for a way to change the display format, and not the numbers themselves, I think you can only do that in ...

2년 초과 전 | 0

답변 있음
Solve many similar fmincon problems with a fully Vectorized Objective function and Analytical gradient + hessian
To vectorize, you must, (1) Sum the elements of f, not take its norm. (2) Vectorize your constraints and their gradien...

2년 초과 전 | 0

답변 있음
Creating new field names within a new structure when trying to reshape data
Your post is hard to follow, so I'm doing a bit of guessing as to what you want. Regardless, I think the data organization strat...

2년 초과 전 | 1

| 수락됨

답변 있음
Problem-based Optimization: Constraint sum(x==1) >=1 doesn't work.
I think it would be better to formulate it like this: A = [1 2 3; 0 3 0]; [rowA, colA] = size(A); k=zeros(3); k(...

2년 초과 전 | 2

| 수락됨

답변 있음
Finding a specific value in Y-axis value with known X-axis value
Alt = [11000,12000,13000,14000,15000,16000,17000,18000]; % Altitude [m] Relative_density_ISA = [0.2971,0.2537,0.2167,0.1851,0.1...

2년 초과 전 | 1

| 수락됨

답변 있음
How to apply calculation over multiple columns in a matrix
The code you've posted already does it, after transposition. x = linspace(0,100,length(presentMatrix)); y = 0:100; newMatrix=...

2년 초과 전 | 2

| 수락됨

답변 있음
How to convert string to optimization variable?
I ended up using "eval" function to solve this issue, but I know "eval" is not recommended. If you have many optimvars, then pi...

2년 초과 전 | 0

답변 있음
My vectors are not the same length
t=linspace(0,500,numel(L.actual_ver));

2년 초과 전 | 1

답변 있음
Fitting to 4D data
Yes, you can use lsqcurvefit.

2년 초과 전 | 0

| 수락됨

답변 있음
How do i plot this with different domain other than unit disk?
syms z a b X(z)=atan(z); Y(z)=z/(z^2 + 1); Z(z)=sym(1/2) - 1/(2*(z^2 + 1)); X(a,b)=subs(X,z,a+...

2년 초과 전 | 0

| 수락됨

답변 있음
Correlation between matrices with different dimensions (spatial resolution)
You can use imresize3 to resampe the arrays at a common resolution.

2년 초과 전 | 0

답변 있음
Using optimisation function "fminunc" for nth number of time
It is because the n that you pass to objectiveFcn(x,Y,freq,n) is being overwritten by n=3 inside your objective function code. ...

2년 초과 전 | 0

답변 있음
Trying to index into a cell array using columns of a matrix
I am trying to use two columns in a matrix Call this matrix I. to index into a cell array. Call it C. Then you could do, a...

2년 초과 전 | 0

| 수락됨

답변 있음
Draw a curve defining the bounds of a scatter plot to detect anomalous (sparse or low density) points
Sets=["xy1" "xy2" "xy3" "xy4"]; Factors=[20,20,5,5]; for i=1:numel(Sets) xy=load(Sets(i)).(Sets(i)); ...

2년 초과 전 | 0

| 수락됨

답변 있음
Pass existing object to different class objects
It will be a "pointer", until you make a change to one of the shared copies. Then, the specific property variables that you chan...

2년 초과 전 | 0

| 수락됨

답변 있음
Problem 2022. Find a Pythagorean triple
function flag = isTherePythagoreanTriple(a, b, c, d) X=[a,b,c,d]; X=X(nchoosek(1:4,3)); flag=any( X...

2년 초과 전 | 0

답변 있음
Problem 2022. Find a Pythagorean triple
function flag = isTherePythagoreanTriple(a, b, c, d) a2=a^2; b2=b^2; c2=c^2; d2=d^2; if a2+b2==c2...

2년 초과 전 | 0

답변 있음
sorting by foor loops
You have many choices, https://en.wikipedia.org/wiki/Sorting_algorithm

2년 초과 전 | 0

답변 있음
Finding exact point on the surface
z = fzero(@(z)y-f(x,z), [z1,z2])

2년 초과 전 | 1

| 수락됨

답변 있음
Parallelizing For Loops - Issue
I would use parfor just to run the n gurobi optimizations. After you've collected all the results in a struct array Results(jr),...

2년 초과 전 | 1

답변 있음
Using rdivide for multidimensional matrices
Using the KronProd class, downloadable from here, https://www.mathworks.com/matlabcentral/fileexchange/25969-efficient-object-o...

2년 초과 전 | 0

답변 있음
Using rdivide for multidimensional matrices
One way: Fp=permute( F([1,3,5],[2,4,7],:), [1,3,2]); Fp_transformed= pagerdivide( Fp , basisVectorMat); F_transform...

2년 초과 전 | 0

| 수락됨

질문


A MEX solution to split classdef-defined object arrays into cells
As an experiment with MEX files, I am trying to create a mex routine that will take an array A of classdef-defined objects and r...

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

1

답변

답변 있음
I don't know why you're saying it's an invalid expression. Help me
Perhaps you intended to have this, y1=sin(x.^2); y2=cos(x).^2;

2년 초과 전 | 0

| 수락됨

답변 있음
trainNetwork - training data format
With your imageInputLayer network, try, XTrain =reshape(XTrain.', 24,1,1,N); so that the format of the input is SxSxCxB.

2년 초과 전 | 0

답변 있음
fmincon with handle function input
The problem is that it is not an explicit function, so it seems that fmincon never stops finding the minimum It is possible th...

2년 초과 전 | 1

더 보기