Answered
Create column vector with same length as a matrix(6x6).
Taking the question literally, one solution would be, (1:6).' but I feel there must be missing information.

6 years ago | 0

Answered
Name-Value Pairs error
If you use inputParser, you can define validation functions https://www.mathworks.com/help/matlab/ref/inputparser.html#d122e665...

6 years ago | 0

| accepted

Answered
How to solve non-linear integer problems (MINLP/INLP)
You will have to use ga() in the Global Optimization Toolbox.

6 years ago | 0

| accepted

Answered
How to code my own Reshape function without using the built in reshape()??
Hint: Notice the effect of doing things like this: A=nan(3,4); A(:)=1:12

6 years ago | 1

| accepted

Answered
Fit the Data to a Quadratic Function with a y-offset (y = b+mx^2) error
I get no error messages when I run your code. However, you do not need fit() to perform this fit. You can just use polyfit, p=p...

6 years ago | 1

| accepted

Answered
Fsolve cannot continue error
The error message is complaining about your objective function, not about FSOLVE. Make sure your objective function equil() is w...

6 years ago | 0

Answered
unconstrained nonlinear optimization problem
Still, there are no constraints, so I think you should be using fminunc. Also, your revised objective function is not differenti...

6 years ago | 0

| accepted

Answered
Problems with a for loop
num2str(ck-1)

6 years ago | 0

| accepted

Answered
Fill a nxm matrix with vectorised expression
No, there is no way to vectorize an element-wise function generically, without considering the specifics of the function. You ca...

6 years ago | 0

| accepted

Answered
Question about a statistics problem
I think you should just do, u = rand(sample_size,loop_times); number_of_success = sum(u<trueVal)

6 years ago | 0

Answered
Finding maximum of a function using optimization toolbox
Assuming you are solving a separate optimization for each i (see my comment above), it seems to me that the solution is very sim...

6 years ago | 0

| accepted

Answered
Trying to Loop through different values of two matrixes simultaneously
You can form all combinations of two matrices using ndgrid, A=rand(3), B=rand(3) [AA,BB]=ndgrid(A,B)

6 years ago | 0

Answered
Create an array containing coordinate points
Usinge mat2tiles from the File Exchange, https://www.mathworks.com/matlabcentral/fileexchange/35085-mat2tiles-divide-array-into...

6 years ago | 0

| accepted

Answered
I want to split a char array '1001' into 1 0 0 1 bits
One way: '1001' - '0'

6 years ago | 1

Answered
Optimizing "nested" variables with a genetic algorithm
The problem with this approach is that all entries of the matrix are scored as individuals. No, that shouldn't be. As long as ...

6 years ago | 0

| accepted

Answered
How to use lsqcurvefit to calculate Urban Heat Island Intensity
You can read all about it here, https://www.mathworks.com/help/optim/ug/lsqcurvefit.html

6 years ago | 0

Answered
What solver for an integer minimization problem with linear objective and fractional constraints?
You can use ga(), if you havet Global Optimization Toolbox.

6 years ago | 0

Answered
avoiding nested for loops for matrix assignment
x = 1:10000; a = x.' + x;

6 years ago | 0

Answered
how apply parfor for this code
No, parfor cannot be applied here. Your loop iterations are not parallel because lfPrev depends on previous iterations.

6 years ago | 0

Answered
Counting Whole Grains of Rice
Go through the list of pixel coordinates in each grain and check if any of them are border pixels. rice_grains=regionprops(bw1,...

6 years ago | 0

| accepted

Question


Is there a way to re-title the Matlab Editor window?
Sometimes, I have multiple Matlab instances open and, within each of those, an undocked Matlab Editor window. It would be helpfu...

6 years ago | 1 answer | 3

1

answer

Answered
Shear Image display problem
You should use an imref2d object to specify the output view, using the syntax, B= imwarp(A,RA,tform,'OutputView',RA)

6 years ago | 0

Answered
1D to 2D interpolation
In order for griddata to work meaningfully, the points xx,yy where you want to interpolate must be surrounded by scattered data ...

6 years ago | 0

| accepted

Answered
variance including in non linear fit
If you mean you want to inversely weight by the variance, just pre-weight your ydata and your model function output, x=lsqcur...

6 years ago | 0

| accepted

Answered
How am I supposed to define each fi(x) functions of a nonlinear least-squares problem?
Assuming w is a 1x3 vector, the expression for each row that you have given (w.*w-2.*xgps[each row].*w+xgps[each row].*xgps[ea...

6 years ago | 0

| accepted

Answered
Copy fields from object cell array into struct array
I would just keep it simple and use a for-loop. There will be no performance gains from doing it some other way. Any abbreviatio...

6 years ago | 2

| accepted

Answered
How to overcome this error?
RHOar is not a row vector, as you seem to expect it to be at line 55.

6 years ago | 0

Answered
how to fix a value in a function during an ode integration, that does not change during the integration
A relevant doc page: https://www.mathworks.com/help/optim/ug/passing-extra-parameters.html

6 years ago | 0

Answered
output argument not assigned during call error
In getSource.m, your switch block is missing an 'otherwise' clause, switch modType case {"BPSK","GFSK","CPFSK"} M = 2; ...

6 years ago | 0

| accepted

Load more