Answered
Combine griddedInterpolants on the same grid
If you know in advande the reference gridded points and the query points, (but the z data change), you migh build one ce interpo...

5 years ago | 0

Answered
Is anyone else having problems with MatLab 2020b freezing when saving/viewing figures? If so do you know any solutions?
I don't know if you have the same problem, in my case I found a large memory leak of TMW graphic system when using opengl hardwa...

5 years ago | 0

Answered
How t generate cone using scattered random point cloud?
This code provides the uniform distribution on the surface of the cone h = 3; % height r = 1; % base radius n = 1e4; % numbe...

5 years ago | 1

| accepted

Question


Why stock DOT function is suboptimally implemented
Followup the discussion in https://www.mathworks.com/matlabcentral/answers/612051-calculation-precision-changed-in-2020b and ...

5 years ago | 2 answers | 3

2

answers

Question


column operator erases complex property
Why column (:) changes my data? (R2020b) >> z=complex(3,0) z = 3.000000000000000 + 0.000000000000000i >> isreal(z) ...

5 years ago | 1 answer | 3

1

answer

Answered
Efficient number occurence count
ac = accumarray(num(:),1);

5 years ago | 1

Answered
How can i extract the value of an element of a sparse double?
full(M(3,3))

5 years ago | 0

| accepted

Answered
NaN from str2double('1 2 3') on Matlab 2020a
"works fine on Matlab 2018b" Are you sure? >> version ans = '9.5.0.1298439 (R2018b) Update 7' >> str2double('1 2 ...

5 years ago | 0

| accepted

Answered
How to multiply 3D matrices without using for loop
If you have R2020b C = pagemtimes(A,'ctranspose',B,'none'); Or using MTIMESX on File-Exchange I just make a quick comparison ...

5 years ago | 0

| accepted

Answered
What frustrates you about MATLAB? #2
MATLAB startup accelerator. I just don't like my computer being polluted by some services installed in the task scheduler. I pr...

5 years ago | 1

Answered
What frustrates you about MATLAB? #2
The camorbit/camlight (camera toolbar) that makes the 3D graphic rotation turns forever when I swing with the mouse. It's fun t...

5 years ago | 0

Answered
How to apply function "strrep" to more than 32 substrings?
newIDFFile = readIDFFile; for k=1:length(x) newIDFFile = strrep(newIDFFile, sprintf('@@P%d@@',k), x(k)); end

5 years ago | 1

Answered
Calculation precision changed in 2020b?
This is a robust code. theta = acos(max(min(dot(x,y)/sqrt(sum(x.^2)*sum(y.^2)),1),-1)) Note it returns 0 for x or y is 0. One...

5 years ago | 1

| accepted

Answered
How to enter variable names into plot title (R2019a)
title("2D Gaussian when mean is " + m(i) + " and standard deviation is " + s(i))

5 years ago | 0

Answered
I want to make a recursive formula and execute two statements with the same variables at the same time
I'm surpised nobody proposes yet a very MATLABish solution [a,b] = deal([a b],a]

5 years ago | 0

Answered
Randomly chooses points from a triangular region and stores the x and y coordinates
This is a direct method, no loop, no discard, etc... n = 1e4; b = 1; h = 2; w1=1-sqrt(rand(1,n)); w2=(1-w1).*rand(1,n); ...

5 years ago | 0

Answered
R2020b AppDesigner doesn't fill UiFigure completely with child
No problem with me here is the capture with R2020b What is your monitor resolution setting?

5 years ago | 0

Answered
MATLAB code for finding certain coefficients
Some detail of the formula is not totally clear to me (do we consider li>=0 or li>=1), but it goes like this (EDIT, assume now ...

5 years ago | 0

| accepted

Answered
How to display exactly 2^64?
They teach me this when I was kid % Raise to power 2^64 d=1; for p=1:64 r=0; for i=length(d):-1:1 a=2*d(i)...

5 years ago | 0

Answered
can linprog handle discrete variables
You might try to use INTLINPROG by introducing (integer) slag variables b2 has the same size as x2 but values in {0,1}. Then ad...

5 years ago | 0

Answered
Diagonal displacement of matrix into another matrix
Simple loop would be the simplest for me % Test matrix A=randi(10,2,8) n = size(A,2)/2 B = zeros(n+1,n+1,n); for k=1:n ...

5 years ago | 0

Answered
The roots for an equation containing tangent
>> fzero(@(x) x*1.4 - atan(0.28*x) - 37.5, 0) ans = 27.8165

5 years ago | 0

Answered
I want to use the L0 norm ?
nnz(x)

5 years ago | 1

Answered
Node Pair list from a graph
nchoosek(1:4,2)

5 years ago | 0

| accepted

Answered
Convex polygon partitioning in MATLAB
Trivially any mesh generator will do this.

5 years ago | 0

Answered
Looking for a very fast root finding method in Matlab
% randomm coefficients for test a=rand(1,10); b=rand(1,10); c=rand(1,10); % assume a ~= 0 tic n = length(a); bn = b./a;...

5 years ago | 2

| accepted

Question


Appdesigner cut/past bug?
When I open R2020b appdesigner of a mapp file created under R2020a, the cut and past menu is grayed out (and action using shortc...

5 years ago | 0 answers | 0

0

answers

Answered
How to compose a function n-times and want value for a particular value of n?
f = @(x) x.^2-x; n = 10; x = 1/pi; y = x; for k=1:n y = f(y) end % y is f^10(x)

5 years ago | 1

| accepted

Answered
How to uniformly sample the surface of a sphere?
There are few methods avialable on File exchange such as this one.

5 years ago | 1

| accepted

Answered
How to find all possible paths from point A to B in any direction in a matrix?
Tiny matrix of size 4 x 3. All paths of two opposite corners: 38 paths for 4-connectivity, 2922 paths for 8-connectivity c...

5 years ago | 1

| accepted

Load more