답변 있음
Solving Matrix Equations With Unknown at Both Sides
T1=optimvar('T1'); T2=optimvar('T2'); F2=optimvar('F2'); prob=eqnproblem; prob.Equations.eqn=[1 -0.5 4;-0.5 2 0; 4 0 3]*[T...

거의 3년 전 | 0

답변 있음
Solving Matrix Equations With Unknown at Both Sides
Since these are linear equations, you would re-arrange in the form Matrix*[T1;T3;F2] =[4; 0; 5] and solve normally.

거의 3년 전 | 0

답변 있음
How to divide a 400x800 matrix to 8x8 blocks?
Processing is usually faster if you keep the data in numeric form. Using this FEX download, https://www.mathworks.com/matlabce...

거의 3년 전 | 0

답변 있음
How to divide a 400x800 matrix to 8x8 blocks?
Easier to use mat2tiles from this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/35085-mat2tiles-divide-ar...

거의 3년 전 | 0

답변 있음
I have a matrix. I want to count number of only those zeros which are lying between 2 sets of consecutive nonzero values on each side. How to do? Desired result given below
Using this FEX download, https://www.mathworks.com/matlabcentral/fileexchange/78008-tools-for-processing-consecutive-repetition...

거의 3년 전 | 0

답변 있음
delete special characters (\ / : * " < > |) in char
One way: name_1 = '<Hello World>'; pat=num2cell('\/:*"<>|'); name_1=erase(name_1,pat)

거의 3년 전 | 0

| 수락됨

답변 있음
delete special characters (\ / : * " < > |) in char
One way: name_1 = '<Hello World>'; tf=ismember(name_1, '\/:*"<>|'); name_1(tf)=''

거의 3년 전 | 1

답변 있음
Change a repeated number with the times the number is repeated in an array.
yourCell={[8.1,2.7,8.1,8.1,2.7]; [6.3 6.3,4,5,6.3]} result = cellfun(@fun, yourCell,'un',0) function y=fun(x) ...

거의 3년 전 | 0

| 수락됨

답변 있음
I cannot run the "fmincon" solver.
error = norm(T_gas_outlet_est - T_gas_outlet).^2;

거의 3년 전 | 0

답변 있음
array of anonymous function
clear obj for k=3:-1:1 obj{k} = @(V) I_fun(V, I0, IL, Rs, Rp, Vt_Ta) - target_value; fplot(obj{k},[0 55],'LineWidth',...

거의 3년 전 | 0

| 수락됨

답변 있음
delete columns inside a cell based on null elements
map = cellfun('isempty',union_cell) tf=all( map(3:5,:),1); union_cell(:,tf)=[]

거의 3년 전 | 0

| 수락됨

답변 있음
An alternative for strlength function for MATLAB 2013
There were no string data types back then, only char vectors, so you could just use length() or numel().

거의 3년 전 | 1

| 수락됨

답변 있음
How can I solve this problem? "Warning: Matrix is close to singular or badly scaled. Results may be inaccurate. RCOND = 8.375012e-18"
I believe the error originates from avec = Mm\b If so, it is because the Mm matrix is singular. The solution would be to make i...

거의 3년 전 | 0

답변 있음
How can I record data from a parfor loop into an array?
Why is this not possible From the documentation for sliced variables (which array is supposed to be in this case): Form of Ind...

거의 3년 전 | 1

| 수락됨

답변 있음
Alphashape boundary detection not working as desired
Try bwlalphaclose() from this FEX submission, https://www.mathworks.com/matlabcentral/fileexchange/90762-further-tools-for-ana...

거의 3년 전 | 0

답변 있음
Getting Not Enough Input Arguments error
My guess is that strcmp(AttributeIndex,ESIDString) is returning false and therefore no arguments are being given as input to cel...

거의 3년 전 | 0

답변 있음
unpack cell array of letters to be plugged into individual-cell rows, in a vector
load infon2 c=infon2(:,end); L=max(cellfun(@numel,c)); for i=1:numel(c) c{i}(end+1:L)=""; end c=num2cell(vertcat...

거의 3년 전 | 0

| 수락됨

답변 있음
surface fitting using a self-defined function
Your model function is not supposed to assume that the xy samples are drawn from a Cartesian grid lattice. ft = fittype(@(a,b,c...

거의 3년 전 | 0

| 수락됨

답변 있음
Operator '+' is not supported for operands of type 'function_handle'.
It's a bad idea (i.e. very inefficient) to add two functions together, however, the proper way would be as follows: g=@(x)x+1; ...

거의 3년 전 | 0

답변 있음
Error while converting polyshape into double
You have pre-allocated ShipImg as a numeric double float vector, ShipImg = ones(1,length(t)); %a double vector of ones Then i...

거의 3년 전 | 0

| 수락됨

답변 있음
How to find the indices of minimum value in a 4D matrix?
[lowestValue,locmin]=min(A(:)) [i,j,k,l]=ind2sub(size(A), locmin); %indices of min

거의 3년 전 | 0

| 수락됨

답변 있음
I have curve fitting in matlab. My graph were all good when not add scatter in the graph. However, when i add scatter coding, the graph were not remain it origin.
It's hard to compare the two plots, because the x- and y-axes ranges are different in each. I suspect if you made the ranges the...

거의 3년 전 | 0

답변 있음
can I pass these nonlinear constraints to lsqnonlin?
Most of the f(x,y) that I am working on are indeed of the form f(x,y)=h(x)+g(y). If this is true, then ensuring the convexity o...

거의 3년 전 | 0

답변 있음
How to check neighbouring elements in a 2D array
load Image BW=bwareaopen(~BW,100); se=ones(7); BW=medfilt2(BW,size(se)); BW=bwareaopen(BW,100); BW=~bwareaopen(~BW,10...

거의 3년 전 | 0

| 수락됨

답변 있음
Find four input combinations with the same output value, and find the one that minimizes the cost function.
It would simply be, Bopt=min(B(A==Astar)); [x_sol,y_sol,z_sol,w_sol ] = ind2sub(size(A), find(B==Bopt));

거의 3년 전 | 0

| 수락됨

답변 있음
How to guess initialization parameters for non-linear curve fitting to get the best fit?
Re-arrange the equation as follows y = a*b*c*x^2 + (a-y*b*a)*x = C*x^2 + D*x Assume C and D can be treated as constants a...

거의 3년 전 | 0

답변 있음
Why does polyfit gives two outputs?
It doesn't give 2 outputs unless you call it with 2 output arguments. The one output that it is giving you is a vector with 2 co...

거의 3년 전 | 0

| 수락됨

답변 있음
How can i pull a matrix out of matrix with indices?
Do it a completely different way. Example A=rand(5) B=rand(5) condition=A<0.5; B(condition)=0

거의 3년 전 | 0

| 수락됨

답변 있음
bilinear extrapolation based on interp2
Although you've been advised against it, if you truly must extrapolate bilinearly then griddedInterpolant will do it for you, [...

거의 3년 전 | 0

| 수락됨

답변 있음
Find the central line (midpoint) of a sinusoidal wave
yline(mean(y))

거의 3년 전 | 1

| 수락됨

더 보기