Beantwortet
Reshaping of 3-dimensional array to construct an isosurface
I just fix the code without knowing what is really your aim. I'm surprise you do all kind of kron and eigs and get lost in the u...

fast 3 Jahre vor | 0

Beantwortet
Eig function and chol function returning wrong matrix factorization
You make two mistakes, please see comments (where "Bruno" appears) in this corrected code %------------------------------------...

fast 3 Jahre vor | 0

Beantwortet
How to get subplots made of a group of already existing .fig
It seems to work for me % I invent this part for fig = 1:8 hf(fig) = figure(fig); plot(sin(linspace(1,fig))); s...

fast 3 Jahre vor | 0

Beantwortet
How MATLAB fft processes data which length is not equal to 2^p (p = 1,2,...)
MATLAB FFT use FFT in the est library. The reference here explain the algorithm http://www.fftw.org/fftw-paper-ieee.pdf

fast 3 Jahre vor | 0

Beantwortet
Extract numbers from a list
succeed = false; while ~succeed c = repelem(4,37,1); n = sum(c); r = rand(1,n); y = []; for i=1:n ...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
Convert 1x1 cell array to double
Not sure if it's more efficient but it's shorter rttTime = str2num(rttTable.vectime{1})

fast 3 Jahre vor | 0

Beantwortet
How to use the quadprog function for solving non-convex quadratic optimization problems in Simulink?
I'm not sure about simulink, but for MATLAB , you have only limited support for non-convex by quadprog: "The 'interior-point-co...

fast 3 Jahre vor | 0

Beantwortet
Find the velocity of a travelling wave like behaviour
%s =load('solution.mat'); %SS = s.sol; % Create fake N and SS N = -20:0.1:20; v = arrayfun(@(x) x/(sqrt(1+x^2)), (1:40)/10...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
Which triangulation Method is used for natural scattered interpolation?
Voronoi tessellation and Delaunay triangulation are two faces of the same coin. They can be derived one from another. https://ca...

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to get rid of this nested for cycles?
If you want to work with cell % simulating similar inputs: K = 3; H = 250; N = 50; B = 10; Q = cell(1,K); rng('default'...

fast 3 Jahre vor | 1

Beantwortet
Edge Detection in a 2D Matrix
Do you want this load(websave('data.mat','https://www.mathworks.com/matlabcentral/answers/uploaded_files/1446792/data.mat')) ...

fast 3 Jahre vor | 1

Beantwortet
How to get rid of this nested for cycles?
There is no reason using cell, rather 4-dimensional array. Admitely the code is not clear if you don't keep track which dimensi...

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
smooth noisy data with spline smoothing
See those threads can help you https://www.mathworks.com/matlabcentral/answers/1772125-how-to-generate-a-smooth-derivative-afte...

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
Indexing nearest value to my coordinate
It is odd that you want to find the index of nc file data closest to the Station. It just sounds more natural to look for the o...

fast 3 Jahre vor | 0

Beantwortet
The multiplication result by sum() and matrix multiplication are not the same
You cannot prevent the roundoff error to occur and operation order dependency. Even for the same computer the result can chang...

fast 3 Jahre vor | 0

Beantwortet
Circular vortex with spin vectors
[x,y] = ndgrid(linspace(-1,1,10)); x = x(:)'; y = y(:)'; xy = [x; y]; r = vecnorm(xy, 2, 1); r(r > 1) = NaN; xyn = xy ./ ...

fast 3 Jahre vor | 1

Beantwortet
how velocize it? (it's possibile to vectorize it?)
I don't know the memory requirement would go up if I vectorize the outer loop in a non-toy case. So I leave it for now. Ntrades...

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
Draw and color the intersection between two 3D surfaces?
It's sphere extruded by a cone x = linspace(-1.1,1.1,129); y = linspace(-1.1,1.1,129); z = linspace(0,1.1,129); [X,Y,Z] = me...

fast 3 Jahre vor | 0

Beantwortet
Network adjacency matrix for connecting n node with probability p
Pretty similar to Torsen's solution. Adjust the density and no-loop p=0.1; n=30; A = GenerateAMat2(p, n); nnz(A)/numel(A) ...

fast 3 Jahre vor | 0

Beantwortet
Network adjacency matrix for connecting n node with probability p
Method without loop, generate entire matrix, symmetrize then remove self-connexion p=0.4; n=10; A = GenerateAMat(p, n); ...

fast 3 Jahre vor | 0

Beantwortet
How to find the index of an element ?
Compare with tolerance epss = 0:0.00001:0.1; tol = eps(0.1); i = find(abs(epss - 0.00208) < tol) % and if you are lazy to es...

fast 3 Jahre vor | 0

Beantwortet
Flipping the elements of a vector
"For larger vectors [1:1e6] the second one gives "Out of memory. The likely cause is an infinite recursion within the program." ...

fast 3 Jahre vor | 0

Beantwortet
How to vectorize?
Just to pull out the right answer (my previous answer applied on a WRONG calculation specified by OP) % vectorized method c = ...

fast 3 Jahre vor | 1

| akzeptiert

Beantwortet
How to vectorize?
If you want obscure code by avoiding for-loop E = rand(10,5) Tr = randi(size(E,1),9,size(E,2)) [r,c]=size(Tr); x=(1:3:r); ...

fast 3 Jahre vor | 1

Beantwortet
abs cannot be used in problem-based optimization expression
Nevermind abs is not supported function https://www.mathworks.com/help/optim/ug/supported-operations-on-optimization-variables-e...

fast 3 Jahre vor | 0

| akzeptiert

Frage


abs cannot be used in problem-based optimization expression
Can someone tell me why I cannot use abs() in this simple setup. prob = optimproblem(); x = optimvar('x',1,1); y = 1; x0 = s...

fast 3 Jahre vor | 1 Antwort | 0

1

Antwort

Beantwortet
How to put matrices defined earlier in "for loop" later
I have no idea if you expect this syms x p_1 p_2 r rho_alpha = (1/21).*[2 0 0 0 2 0 0 0 2;0 5-x 0 0 0 0 0 0 0;0 0 x 0 0 0 0 0...

fast 3 Jahre vor | 1

| akzeptiert

Frage


using feval or not?
I have function handle myfun I need to evalute I prefer using feval https://www.mathworks.com/help/matlab/ref/feval.html y = f...

fast 3 Jahre vor | 1 Antwort | 0

1

Antwort

Beantwortet
Is it possible to programmatically suppress figure roll-over menu (zoom, rotate, etc)?
ax = gca; % your axe handle if you can get it other than gca set(ax,'Interactions',[])

fast 3 Jahre vor | 0

| akzeptiert

Beantwortet
How to get the current rotation angle of an object when using interactive vol=volshow(img3D)?
axehandle = gca [az,el] = view(axehandle)

fast 3 Jahre vor | 0

Mehr laden