Here in my code I defined A vector and B vector for my linear programing, the relationship between them is Ax=<B which A is a inequlity vector and B is a RHS and x is variable. the Error is in photo which i attached .how can I solve it?
This problem is happening because |load_kw| is probably not a scalar, wheres your code seems to indicate it is a scaler. If It i...

| 採用済み

Building a Forest of Trees in MATLAB
This live script demonstrates the use of handle classes by creating and visualizing tree structures in MATLAB.

Find the parameters of integration
Try this. This requires optimization toolbox. This uses the sum of squared error from your equations as an objective function. ...

Passing a component as an argument in App Designer
I have attached an example app, in which I have three axes and I have written a simple function which plots random values on inp...

| 採用済み

How to setup system of linear equations in matrix form?
You can do it by making a matrix |A| of coefficients and a matrix |b| of the number on right side of the equations. A = [c...

help to read and write to .txt faster

How to See Each Formulate Numbers on Regionprops
The following will give you a vector of all area values areaValues = [s.Area]; concatenation operator |[]| is important....

| 採用済み

How to fix this issue in the graph??
That is because you are adding nodes to |Gvsub| and saving it in |H|, the |Gvsub| variable does not change and in next iteration...

| 採用済み

Ignoring markers and lines in legend
From legend documentation, it appears that MATLAB does not support direct control over |legend| markers. They are decided automa...

How do I scale coordinates for different image sizes?
You can use |interp1()| to linearly map the coordinates from old image size to new image size. x_new = interp1([1 900], [1 ...

How to solve an equation with two vectors
|'%g'| is for numeric type, since your |v| vector is |sym|, therefore, you need to use |'%s'| syms t A=[-7,3,-1]; B=[1,0,5...

| 採用済み

fzero: Not Enough Input Arguments
Since your number of equations (100) is greater than the number of variables (5), the best you can expect is a least square solu...

| 採用済み

How to create a multiple linear regression model
Your use of |fitlm()| is correct. Alternatively, if you don't need all the extra information provided by |fitlm()| and speed is ...

how to resample points with preset angle
Try this x = points(:,1); % first column of points you shared y = points(:,2); % second column of points x_new = int...

| 採用済み

gca.XLimMode does not work
If you check the |xLimMode| after running your code, you will see that it has changed back to |auto| after the |plot()| statemen...

| 採用済み

How to pad extra 0 after 5 consecutive 1's in an array
Try this a= [1 1 1 1 1 1 1 1 1 1 1 1]; b = a; count = 1; while true index = strfind(b(count:end), [1 1 1 1 1])+5; ...

Increasing increment values with vector operations
difference = 11:2:29; a = 25+[0 cumsum(difference)] a = 25 36 49 64 81 100 121 144 169 196 ...

Not able to add 2d array to 3d array
The error is probably caused because the dimension of |cycle| are not |[50000 x 4]|. Also, if |cycle| is has a constant value th...

Multiple line plots of matrix with color depending on other vector
The order of plot colors is decided by the |ColorOrder| property of the |axes| object. You can access this property as ax =...

How can I change the rows of a nchoosek matrix to zero, according to a specific pattern, and avoid nested while loops?
Here is my attempt to generate the pattern as described in your question, there might be more efficient ways. combs45 = nch...

| 採用済み

fun(@x)
If you have a vector of |x| and |y| values then you can use several functions to estimate |B|. The correct method to use dependi...

The variable appears to change size in every loop iteration, I have no idea how to fix. I get this for divDIF Line 13 and a line 21.
This is not an error, this is a warning which |mlint| produce to increase the speed and efficiency of your code. It is better to...

Trajectory designing Matlab code
You can use <https://www.mathworks.com/help/simulink/slref/fromworkspace.html From Workspace> block to transfer trajectory signa...

hi..Im new in matlab programming. Can someone help me plot 3D graph of y=x-x^2, where z is form negative infinity to infinity.
If you want to plot something the 3d surface plot of this equation z = y - x + x^2 then try x = linspace(-0.5, 0.5)...

is there a way to get the values associated with the *minor* tick marks?
ax = gca; get(ax.XAxis, 'MinorTickValues') For R2014b and later, following also work ax = gca; ax.XAxis.MinorTickV...

| 採用済み

how to get an analytical solution
The existence of an analytical solution is not always necessary. I cannot prove mathematically but it might be the case that thi...

| 採用済み

Trying to isolate rows in a specific time
First of all, your |csv| file is not properly formatted. So it is difficult to use |csvread()| or |readtable()| directly. The fo...

| 採用済み

X and Y axis labels overwritten and illiegible
I don't have your data, therefore, can't test the complete code but I guess the problem is happening because your code is effect...

How do you get a global average at each time step so they can be summed?
If you want to average at each time step as by omitting the |sum()| function. For example averageTimeSteps = mean(mean(mean...

| 採用済み

Number of precision digits( sum(sum(A)) not equal to sum(A:)
It might be happening because of finite precision of floating point numbers, Also, calling the |sum()| twice seems to be amplif...

| 採用済み