Réponse apportée
how to velocize it (avoid loop is possible)
E=[0 5 6 9 2;0 0 1 3 1;0 5 4 2 4]'; [~,I]=max(logical(E),[],1); filtro=(1:height(E))'>I

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Plot a set of points in a standard simplex
For 2D: p=nsidedpoly(3); c=rand(10,3); c=c./sum(c,2); v=num2cell(c*p.Vertices,1); %"probability vectors" plot(p); axis...

plus de 2 ans il y a | 3

Réponse apportée
how to calculate product of two 3D matrices (both 101 by 101 by 101 ) in matlab ?
u=randi(10, 3,3,2) u.^2

plus de 2 ans il y a | 0

Réponse apportée
Set tick in Axes plane
That's pretty fancy. But no, I'm pretty sure Matlab doesn't have it.

plus de 2 ans il y a | 0

Réponse apportée
Faster Image Processing?
[m,n,p]=size(Image); N=cellfun(@numel, pointer(:)); K=cell2mat( cellfun(@(q)q(:)', page(:),'uni',0)); %*ConstantMultipli...

plus de 2 ans il y a | 0

Réponse apportée
Reduce the objective function value in fmicon
For this objective function value is coming in the order of e+10 You seem to think this value is large and far from the optimum...

plus de 2 ans il y a | 1

Réponse apportée
The fastest method to perform sum of function
dx = 0.1; dy = 0.15; dz = 0.05; xmin = -2; xmax = 4; ymin = -2*pi; ymax = 2*pi; zmin = -1; zmax = 2; xs = xmin:dx:xmax;...

plus de 2 ans il y a | 0

Réponse apportée
train a Neural network with different input output sizes
If it's a sequence-to-one regression then this syntax of trainNetwork would be appropriate, net = trainNetwork(sequences,respon...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Extrapolating x from a given y value using a curve-fitted cfit equation.
x=fzero(@(z) val(z)-y, z0)

plus de 2 ans il y a | 1

Réponse apportée
Two-variable optimization with additional conditions
The constraint is equivalent to minimizing over the intersection of the unit sphere and a plane through the origin (normal to n0...

plus de 2 ans il y a | 0

Réponse apportée
What could be the reason for this fzero error and how to solve it ?
You should plot the function to get a better idea where the solution is, dd = 0.1069; vv = 0.7889; L = 1; fun = @(aa) ( (...

plus de 2 ans il y a | 1

Réponse apportée
How to change size of plot points
savtotal=1000; % initial amount hold on xlabel("Time (Months)") % graph labels ylabel("Amount Saved ($)") title("College Sav...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
How to apply for loop in case of product of function inside double summation?
The most efficient approach, especially as a and b become longer, is to separate the sums, leading to a one-line computation: P...

plus de 2 ans il y a | 1

Réponse apportée
Remove points in a 3D matrix that lie inside a 2D polygon on each layer
and effectively eliminate a column from the mri by adjusting the values of all points within that same polygon to 0 on every sli...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
How to segment a matrix into N regions with sizes XYZ?
I'm not sure how to do an area-preserving transformation in Matlab See imwarp.

plus de 2 ans il y a | 0

Réponse apportée
Need help graphing gradient of 2D polynomial
[Gx, Gy] = differentiate( sf, X, Y ); figure; surf(X,Y,Gx); title('X-Gradient') figure; surf(X,Y,Gy); title('Y-Gradient')

plus de 2 ans il y a | 0

Réponse apportée
I want a Matlab Program for creating a single frame with combined plots of a surface plot of a two-dimensional standing wave field in addition to an image of projection plot
x = linspace(-1, 1, 100); y = linspace(-1, 1, 100); [X, Y] = meshgrid(x, y); frequency = 1; amplitude = 1; Z = amplitude * sin...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Using lsqcurvefit for parameter optimisation
Since you are just trying to verify the results of a previous paper, initialize with the solution parameters that the paper prov...

plus de 2 ans il y a | 0

Réponse apportée
returning a unique array and comparing it with a different array.
The whole thing can be done in one line. No need for unique, reshape, or any of the rest of it. result = ismembertol(a,y_cosno...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Improving performance of parallel code sections
The task is too small for parallelization to have any meaningful effect. Similarly, the relative performance numbers for the dif...

plus de 2 ans il y a | 0

Réponse apportée
Is it possible to have a line graph with a different marker for each point on the same line?
You can effect that as below. I don't see why you'd want it, however. x = 1:5; y = [2, 3, 1, 4, 2]; xc=num2cell(x); xc{end+...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
Fminsearch does not work after increasing maxiter
The warning is not coming from fminsearch. It is coming from the ODE solver. As fminsearch iteratively explores different choice...

plus de 2 ans il y a | 0

Réponse apportée
How do I make the fit better so that there are no negative y-values for the fit?
Why use fit() if you just want to interpolate? Why not use interp1 with the 'pchip' method instead? clc; clear all; %% --Va...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
How do I make a secondary Y axis
It is, unfortunately, a very awkward thing to do. The datatip will show y3 with an increment of 200, but there may be ways to cu...

plus de 2 ans il y a | 2

Réponse apportée
How to get equispaced values with a more exact result than using linspace and column functions?
I want exactly equispaced output There is no such thing as exactly anything in floating point computation. The inaccuracies you...

plus de 2 ans il y a | 1

Réponse apportée
MATLAB won't run script unless functions are defined in a specific order?
As long as all your functions are placed at the bottom of the script, it shouldn't matter what order they are in.

plus de 2 ans il y a | 0

Réponse apportée
Sort function indices in regards to the original data?
[val,is] = sort([86.9565 69.5652 65.2174 52.1739 43.4783 65.2174 91.3043 60.8696],'descend'); idx=1:numel(val);...

plus de 2 ans il y a | 2

Réponse apportée
How to split array into sub arrays?
a = [1 3 5 8 11 12 15 17 18 19 20 21 24 29 31 32 33 34 35 36 38 39]; G=findgroups(discretize(a,[0:10:max(a)+10],'Include','ri...

plus de 2 ans il y a | 0

Réponse apportée
Cubic interpolation coefficients and basis matrix
Using this FEX downloadable, https://www.mathworks.com/matlabcentral/fileexchange/44669-convert-linear-functions-to-matrix-form...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Getting points back from convexhull/trisurf, or 'how to find the closest point on a 3d surface to a given point.
This might be what you're looking for, https://www.mathworks.com/matlabcentral/fileexchange/52882-point2trimesh-distance-betwee...

plus de 2 ans il y a | 0

| A accepté

Charger plus