Réponse apportée
Concatenating matrices in a structure with same size into a 3D array.
x_mat.mat1=rand(100, 5); x_mat.mat2=rand(100, 5); x_mat.mat3=rand(100, 5); x_mat.mat4=rand(100, 5); c=struct2cell(x_mat); ...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
How can i solve initial value ordinary differential equation using matlab ??
I change integration variables to v=u*s and w=u^2*s; This should work (you need to sort out the discrepency of unit, speccially...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
struct function in Matlab
I recommand ro Store them in 4D array 16 x 16 x 16 x 1e4 No reason to use struct or cell or any other structure. It would make...

plus de 2 ans il y a | 0

Question


ismembertol second output specification
The command ismembertol it looks if elements of the first array belong to the second array with tolerance. The second output a...

plus de 2 ans il y a | 1 réponse | 0

1

réponse

Réponse apportée
comparing two matrices of different dimensions
Fix several bugs of your for-loop code load('data1.mat'); load('data2.mat'); A=data1; B=data2; num_rows1=size(A(:,1),1); ...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
How can I assign a set of data from a 'meta.class' object propertys to a string array without using a loop statement?
cellarray... not array mc=?ClassA; K={mc.MethodList.Name} %or if prefer M=string(K)

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
how to velocize it (vectorizing)
I don't know why a is matter beside that the first dimension is 10 a=magic(10); b=[4;5;9;2;3;4;2;7;4;9]; %width(a) element ...

plus de 2 ans il y a | 0

Réponse apportée
Where was the empty array created?
"1 So, is this 7*0 Base array stored in 'a,' ?in 'b'? or does 'a' and 'b' each have a separate 7*0 Base array? Why?" This quest...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Having each row compare its string with other rows within the problem and getting corresponding data relative to the string in other columns.
Not sure if you want this A=readtable('https://www.mathworks.com/matlabcentral/answers/uploaded_files/1460327/Book1.xlsx'); he...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Non-infinite recursion generating the message, "Out of memory. The likely cause is an infinite recursion within the program."
You recursion stop test is wrong, it does not take into account that basic matrices can be 1 x 2 or 2 x 1. I let you prove why ...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
Skewness calculator using one pass algorithm. Code speed up needed.
Implement skewness in C-mex #include "mex.h" #include "matrix.h" #include "math.h" /* compile command mex -O -R2018a s...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
How to split a irregular polgon into different parts having specific area for each part?
Same question answered here https://www.mathworks.com/matlabcentral/answers/586937-how-to-split-a-polygon

plus de 2 ans il y a | 0

A soumis


RotationMean
Mean of the (3 x 3) rotation matrices

plus de 2 ans il y a | 3 téléchargements |

0.0 / 5

Réponse apportée
Moving window Autocorrelation. One pass algorithm. Speed and Stability concerns.
Do not put if inside loop, start the loop from i=2 and do i=1 outside Do not compute inside the 2nd loop std(x(idx - window_si...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Skewness calculator using one pass algorithm. Code speed up needed.
Simple factorize common quantities used in updating M1, M2, M3 function skewness = skewness_onepass_BLU2(x) N = length(...

plus de 2 ans il y a | 0

Réponse apportée
Remove zeros from a vector from a specific position
remove = all(~X,2); remove(1) = false; X(remove,:) = [];

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
it's possible to velocize this loop?
@piero Your question/code is awfully asked: no comment, no description, cannot run as it is, debug code left over, etc.... load...

plus de 2 ans il y a | 2

| A accepté

Réponse apportée
row ranking among multiple matrices
Just very standard matlab programming % Generate test data N=10; M=3; A=rand(N,M)+1i*rand(N,M); MB = 1; MC = 2; B=randi(10...

plus de 2 ans il y a | 2

| A accepté

Réponse apportée
How to find the intersection values?
d1 = 0.4;d2 = 0.6;d = d1 + d2; n1 = sqrt(12);n2 = 1; lambda = linspace(400e-3,800e-3, 100000); D1 = (2*pi*n1*d1)./lambda;D2 =...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Averaging rotation matrices and calculating the variability
It is not quite straightforward to compute the mean of rotation vector. The mean should be performed on SO(3) and any attemps ...

plus de 2 ans il y a | 1

Réponse apportée
the mass matrix and Jacobian matrix in ode15s
This script tests the formula with dummy test configuration by comparing with the Jacobian obtained from finite difference: run...

plus de 2 ans il y a | 2

Réponse apportée
Fastest way of submatrix multiplication
Take a look at pagemtimes Why don't you post the i-loop? In general why people don't post code that can run.

plus de 2 ans il y a | 1

| A accepté

A soumis


ricb
Random integer numbers with specified sum and bound constraints

plus de 2 ans il y a | 1 téléchargement |

0.0 / 5

Réponse apportée
why does conv2 increase z height?
Properly blurring without boundary dropdown artefact: K = ones(15); blurredImage = conv2(data, K, 'same') ./ conv2(ones(size(d...

plus de 2 ans il y a | 0

Réponse apportée
How can I select two out of 6 points for every page without loops?
n = 4; nsolperpage = 2; X = randi(40, [6, 3, n]) mask = all(X >= 0 & X <= 30, 2); [~,p] = find(reshape(mask, [], n))...

plus de 2 ans il y a | 1

Réponse apportée
floor((I3(i,j-1)+I3(i-1,j))/2)
@RENJI "the expression evaluates to 192.5" The above is a FALSE statement since (I3(i,j-1)+I3(i-1,j))/2 cannot have fractional ...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
floor((I3(i,j-1)+I3(i-1,j))/2)
Set a breat point in your program, when it breaks type this and report the result I3(i,j-1) I3(i-1,j) (I3(i,j-1)+I3(i-1,j))/2...

plus de 2 ans il y a | 0

Réponse apportée
Nested for loops to compile all possible combinations of two vectors
vector1 = [1 2 3 ]; vector2 = [2 4 6 ]; [V1, V2] = meshgrid(vector1, vector2); A = [V1(:), V2(:), V1(:).*V2(:)]

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Solving self-consistent equations that involve matrices
Use fixpoint to find good startting point for lsqnonlin: this code converges and find a solution: % System Parameters E = 8.5;...

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
How to using try and catch correctly to force loop go to next iteration?
Your try/catch works just fine, but your files are failed in the row. But as you are too lazy to check it is true or not it is j...

plus de 2 ans il y a | 0

Charger plus