Answered
I'm trying to have a vector of alternatinating 1 and 2 that correspond to another vector of min and max values and time
You can use groupTrue and groupFcn (to be downloaded) , B=[1 2 1 2 2 1 1 2 1 2 1 2 1 2 1 1 2 1]; C= [2 5.3 1.2 6.5 5.5 1.3 1...

5 years ago | 0

| accepted

Answered
How interp2 deal with edges on bicubic interpolation?
Based on a little reverse engineering, I believe I have discovered that the 'cubic' method of interp1 uses quadratic extrapolati...

5 years ago | 0

Answered
Non-Linear Curve fit: Error using svd
There are regions of the b(i) space where your model function will evaluate to a complex number, or to a non-finite value. You n...

5 years ago | 0

| accepted

Answered
Find a variable to make equation = 0
For the data that you have shown, there is no solution. Whenever ky^2*kob*Tob is non-zero, then the only possible location where...

5 years ago | 0

Answered
Why fminsearch result is the same as Start Value and it is not optimized.
Generally speaking, fminsearch will not work well for problems with more than about 6 unknowns. Theoretically, it is only proven...

5 years ago | 0

Answered
How to find elements of a vector falling between minimum and maximum of an other vector without loop.
a=(1:1:10); b=[5.5 11]; [~,~,c]=histcounts([0,5.5,10,11],[min(a),max(a)+eps(max(a))])

5 years ago | 0

Answered
Loop multidimensional array doesn't work
You could fix it by changing the opening of your for-loop to, for i = 1:size(x,2) but below is a more efficient loop-free meth...

5 years ago | 0

| accepted

Answered
Replacing elements of a matrix of those of a Cell Array
Perhaps as follows? club = {'ARS','VIL','BRE','BRI','BUR','CHE','CRP','EVE','LEE','LEI','LIV','MNC',... 'MUN','NEW','NOR'...

5 years ago | 0

| accepted

Submitted


PROB2MATRICES: A selective version of prob2struct
Obtains matrices for select parts of an optimization problem from problem-based description.

5 years ago | 71 downloads |

0.0 / 5

Answered
Enclosing Boundary - for blobs
Perhaps as follows, BW0=load('Image.mat').BW; BW= imclose(BW0,strel('disk',3)); BW = imfill( BW ,'holes') ; BW=bwareafilt(...

5 years ago | 1

| accepted

Answered
Accessing specific values in every matrix in a cell array
I want to get all the z-values in each cell and put them into a matrix without using loops. Even with built-in Matlab functions...

5 years ago | 0

| accepted

Answered
How to visualize the iterations of an optimization problem ?
function main xhist=[]; prob = optimproblem %defining variables x= optimvar('x',"LowerBound",-2.5,'UpperB...

5 years ago | 0

| accepted

Answered
Could anyone help me on what basis the number of hidden layers are chosen for deep neural network.
But I would like to know is there any other reason other the mean square error to justify why four hidden layers are optimal. N...

5 years ago | 0

Answered
Solving Ax=b but only for the values in some rows of x
Indeed, I am solving it for multiplie right hand sides with A fixed If so, then you should be solving with multiple concatenate...

5 years ago | 1

Answered
Save double vector in matrix in for loop
The line, d_df_mat = zeros(10,5); should be prior to the loop, not inside it.

5 years ago | 1

| accepted

Answered
Pick matrix vom struct with certain probability
edges=cumsum([0,spec]); switch discretize(rand,edges) case 1 selection = Econtainer.E_low; ...

5 years ago | 0

| accepted

Answered
bsxfun operations on gpuArrays generate too many output arguments
I cannot reproduce the problem in R2018a. Until the cause is understood, a solution might be to simply not use bsxfun. B=A-mea...

5 years ago | 0

Answered
How to display numbering (for example : 1 2 3....... so on) on each image frame in a montage?
The only way to do that with montage() would be to burn the label directly into each image before stitching them together.. Per...

5 years ago | 0

Answered
Newton Raphson for multivariable function
There is no built-in implementation of Newton-Raphson in Matlab, but fsolve() is pretty similar, so you could use that.

5 years ago | 0

| accepted

Answered
Determine point spread function of a single pixel image
If you intend to model the PSF as a 2D Gaussian blob and you have the Optimization Toolbox then you can use this ready-made func...

5 years ago | 0

Answered
Create a matrix of element (lines) points connectivity
nelments = 3; npoint = 5; connect=(1:npoint) + (npoint-1)*(0:nelments-1).'

5 years ago | 0

| accepted

Answered
Fitting a model of a membrane with fminsearch
We can't see your "error_function", but you need to check its syntax and make sure it only expects a single input argument.

5 years ago | 0

| accepted

Answered
for loop only shows the value of last iterations
Here is what you could do. I=min(R):max(R); G=discretize(I,[-inf,0.6,7,inf], 'IncludedEdge','right'); P1=nan(size(I)); ...

5 years ago | 1

Answered
Calculate the rotational angles of a transformed coordinate system
You can use the attached file to get the rotation angles (in degrees). Rblack=normalize( [Xb(:),Yb(:),Zb(:)]-NPb(:) ,1,'norm')...

5 years ago | 1

| accepted

Answered
Expand vector into 3-D matrix
It seems like a waste of memory to make so many copies, but here is how it could be done: result = repmat(reshape(vector,1,1,[]...

5 years ago | 0

| accepted

Answered
Shouldn't bwconvhull() be idempotent?
Below is a 3rd version of the function I proposed in my various conversations with Steve and Jonas. Assuming one is happy with t...

5 years ago | 0

Answered
How to evaluate a vector into a Matrix?
E= 3000; I=1; L=reshape( [4;5;1.5;1.5] , 1,1, []); kelemento=[12*E*I./L.^3 6*E*I./L.^2 -12*E*I./L.^3 6*E*I./L.^2; ...

5 years ago | 0

| accepted

Answered
How to quickly do the calculation?
This might be faster. r=false(6000,1); r(mmm(jbb2))=1; c=false(3000,1); c(IndBus(solvedbuses))=1; Ieq1=Haltmr*sparse(v.*c);...

5 years ago | 0

| accepted

Answered
How do I evaluate the double integral of ye^xy over the intervals 0,2 and 0,3?
You probably mean to write fun=@(x,y) y.*exp(x.*y) but instead put fun=@(x,y) y.*exp(xy)

5 years ago | 1

Answered
Rotate matrices about a point
dt=flip(size(V)/2+0.5) - [-2.117,-8.053]; Vrotated = imtranslate( imrotate( imtranslate(V,dt) , -20) ,-dt); %the result

5 years ago | 0

Load more