Beantwortet
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.

mehr als 2 Jahre vor | 0

Beantwortet
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')

mehr als 2 Jahre vor | 0

Beantwortet
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...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 2 Jahre vor | 0

Beantwortet
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...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 2 Jahre vor | 0

Beantwortet
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+...

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
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...

mehr als 2 Jahre vor | 0

Beantwortet
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...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 2 Jahre vor | 2

Beantwortet
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...

mehr als 2 Jahre vor | 1

Beantwortet
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.

mehr als 2 Jahre vor | 0

Beantwortet
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);...

mehr als 2 Jahre vor | 2

Beantwortet
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...

mehr als 2 Jahre vor | 0

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

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
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...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
How to get a smooth boundary between clusters?
Once you've extracted the boundary points, you could use sgolayfilt to smooth them.

mehr als 2 Jahre vor | 1

Beantwortet
Computation of the distance of the points from the interpolation curve?
dist = pdist([flowrate y], 'euclidean','Smallest',1);

mehr als 2 Jahre vor | 1

Beantwortet
Which algorithm does SVD function take?
The SVD algorithm is not disclosed by MathWorks, but even if you could be sure the same algorithms were used by both Matlab and ...

mehr als 2 Jahre vor | 2

| akzeptiert

Beantwortet
shade the area between curves
% Define the data as column vectors x1 = [0.001 0.055178 0.06313 0.071457 0.072486 0.089794 0.099338 0.099518 0.107103 0.118855...

mehr als 2 Jahre vor | 0

Frage


How to detect whether a figure is created by uifigure()
I have the following in my startup.m file, set(groot,'defaultFigureCreateFcn',@(fig, ~)addToolbarExplorationButtons(fig)); ...

mehr als 2 Jahre vor | 2 Antworten | 1

2

Antworten

Beantwortet
Can I upload the results of my work with a home license to GitHub?
I don't think any of the licenses restrict your ability to share your code, with the obvious caveat that if you try to sell it ...

mehr als 2 Jahre vor | 0

Beantwortet
For matrix A you cannot do: A.^2(:)
You cannot apply ()-indexing to mathematical expressions, function calls, or literal constants, only to variables. So, in your c...

mehr als 2 Jahre vor | 1

| akzeptiert

Beantwortet
Piecewise Function (Toolbox Doesn't Work)
Why bother with symbolic math? Why not just plot as below? n=linspace(-2,5); f = @(n) (3*exp(-n).*sin(pi*n)).*(n>=0); plot(...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
How to add colorbar using image data
I would guess maybe, colormap parula However, we really need to see the corresponding grayscale image to make an informed choi...

mehr als 2 Jahre vor | 0

Beantwortet
How to remove surface segments produced with trisurf (based on delaunyTriangulation)?
You could use faceNormal to find which facet normals are sufficiently aligned with the z axes as to consider them part of the to...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
What is the Distinction Between Answers and Discussions?
Answers is intended for seeking solutions to difficulties encountered by the OP in using Matlab. Discussions is not for solutio...

mehr als 2 Jahre vor | 2

Beantwortet
How can I maximize a tiled layout in a live script?
TL=tiledlayout(3,1); Fig2=TL.Parent;

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Hi, I am plotting surfaces and I want to connect them with interpolation, but I don't know how.
% Define the data as column vectors x1 = [0.001 0.055178 0.06313 0.071457 0.072486 0.089794 0.099338 0.099518 0.107103 0.1188...

mehr als 2 Jahre vor | 0

| akzeptiert

Beantwortet
Why does a griddedInterpolant use twice as much memory as the array of values that it's interpolating between?
I suspect that griddedInterpolant does not really consume twice what V consumes. I think it is just a quirk of whos(). Remember ...

mehr als 2 Jahre vor | 0

| akzeptiert

Mehr laden