Réponse apportée
partition column randomly in to three columns
The three parts has "almost" equal number of elements A=rand(10000,1); % dummy test data G=splitapply(@(x){x},A,randi(3,size...

environ 4 ans il y a | 0

Réponse apportée
How can I zoom in/out in a plot with two x axes?
Probably using linkaxes hAx1 = gca; hAx = axes('Position',hAx1.Position,'XAxisLocation','top','YAxisLocation','right','color',...

environ 4 ans il y a | 1

Réponse apportée
Nonlinear differential equation with unknown parameter
Solving up to PsiMax = 1000; which returns V = 0.823. Still not recommended to set PsiMax too large, just to show a more robust ...

environ 4 ans il y a | 0

Réponse apportée
How to get_ride of NaN values in a cell?
IMH this is correct statement inside the double for-loop e{ii, kk}=a(a(:, ii)>L_lim(:,kk) & a(:,ii)<U_lim(:, kk), ii);

environ 4 ans il y a | 0

| A accepté

Réponse apportée
help ! how do i fix this error : Error using .* Integers can only be combined with integers of the same class, or scalar doubles.
Add cast to double statement after reading your image im=imread(' image.png'); im = double(im); ...

environ 4 ans il y a | 0

Réponse apportée
Create least squares fit for linear combinations
first write a2 = 1 - a1 replace in the first equation with y, solve for a1, then a2

environ 4 ans il y a | 0

Réponse apportée
generate random number between positive and negative and sum of this number is zero
You probably need this: https://www.mathworks.com/matlabcentral/fileexchange/9700-random-vectors-with-fixed-sum

environ 4 ans il y a | 1

| A accepté

Réponse apportée
Subtracting polynomial from piecewise polynomial
x=cumsum(rand(1,5)); x = x-mean(x); % Test pp y=rand(size(x)); pp=spline(x,y); % Here is ppsubx2 a pp-form of pp-x^2 x0=...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
Is there a faster way to implement a FIFO (queue) ?
If you don't need to retreive the whole FIFO in order, but read and write element by element, then the best way is NOT rearrange...

environ 4 ans il y a | 0

Réponse apportée
how can i do Matrix multiplication with 3 matrices
sum(x.*rij,2)' * ai

environ 4 ans il y a | 0

| A accepté

Réponse apportée
How can I generate random integers from 1 to 'n' in a jagged array(matrix of different row size) ?
n=4; % number of "circuit" m=15; % tubes c=mat2cell(randperm(m),1,diff([0, sort(randi([0,m-n],1,n-1)), m-n])+1)

environ 4 ans il y a | 0

| A accepté

Réponse apportée
Array multiplication returning single value
"What am I missing?" Use elementwise multiplication ".*" and not matrix multiplication "*" (remove the double quote).

environ 4 ans il y a | 0

Réponse apportée
Solving a 6th order non-linear differential equation in Matlab
Using bvp4c eta0 = 10; eta = linspace(0,eta0,100); yinit = [1e4;0;0;0;0;0]; solinit = bvpinit(eta,yinit); sol = bvp4c(@fun_...

environ 4 ans il y a | 0

Réponse apportée
How to slice an outer surface plot to reveal an inner surface plot in MATLAB?
Use NaN to remove points you don't want to see, adapt to your need [X,Y,Z] = peaks(75); [Xa,Ya,Za] = peaks(50); Z(X<0 & Y<0) ...

environ 4 ans il y a | 1

| A accepté

Réponse apportée
Reduce a matrix to unique values, randomly choose which values are discarded
% Dummy data A=randi(10,52,5); [~,~,J]=unique(A(:,1)); r=(1:size(A,1))'; rr=accumarray(J,r,[],@(r) r(randi(numel(r)))); r...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
Dot product of tensor
If you have the R2022a, a single statement will do A=rand(2,3,3); B=rand(4,5,3); C=tensorprod(A,B,3); size(C)

environ 4 ans il y a | 2

| A accepté

Réponse apportée
which function to us to check if a struct name exists
try/catch after reading your struct try data = a.b.c.d; catch try data = a.b.x.d; try ...

environ 4 ans il y a | 0

Réponse apportée
How can I assign values to a Structure with multiple subfields with one line of code?
Not sure about your claim of one statement is faster than for loop. Whatever here is oneline code Exampe = struct() [ExampleSt...

environ 4 ans il y a | 0

Réponse apportée
Is the .tiff structure in Matlab 2020a and Matlab 2020b/2021 different?
MATLAB has several ways to write tiff file, imwrite, print, Tiff class, etc... Which function are upu using and what type the da...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
which function to us to check if a struct name exists
Use function isfield

environ 4 ans il y a | 0

| A accepté

Réponse apportée
How to find the matchings of the given graphs?
See if the maxmatching FEX can be useful for you.

environ 4 ans il y a | 0

Réponse apportée
Calculating the eigen vectors without using eig function but using a data set, the transpose of the data set and a unit vector
Your method give you the largest singular vector not eigen vector: A=rand(5); C=A'*A; u=randn(size(A,2),1); u=u/norm(u); ...

environ 4 ans il y a | 0

Réponse apportée
Why do I have 2 version installed after update?
You can uninstall the older version, but shouldn't disavtivate MATLAB license on your computer.

environ 4 ans il y a | 1

| A accepté

Réponse apportée
How to distribute data as Gaussian?
May be this thread can help you https://fr.mathworks.com/matlabcentral/answers/1677599-how-do-i-generate-a-random-number-betwee...

environ 4 ans il y a | 0

Réponse apportée
Find minimal possible term x by trying out various combinations of other terms for a known sum
You need first to formulate your problem in consist unambiguous math problem. So I unstand you have an array A with n-numbers ...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
Lagrange multiplicator with discrete constraints converges to local minimum
So you try to be smart and expect to find the minimum of a function 9 distinct points in {-1,0,1} x {-1,0,1} using continuous gr...

environ 4 ans il y a | 0

Réponse apportée
Unable to perform assignment because the left and right sides have a different number of elements.
You get coding errors at least in this two lines f=@(x) 1./(x.*(4-(9*x))); ... int1(m+1)=w1*f(x1)

environ 4 ans il y a | 0

Réponse apportée
How to use a code that uses FFTW in MATLAB?
After I generate the code, how can I use it as a part of my MATLAB code? Is the generated code intended to be used in an executi...

environ 4 ans il y a | 1

| A accepté

Réponse apportée
how to repeat [5,4,3,2,1.....] infinitely?
A meta-array: x = rep5to1(100:120) %% function x = rep5to1(i) a=5:-1:1; x = a(mod(i-1,length(a))+1); end

environ 4 ans il y a | 0

Réponse apportée
Create vector with unique values
Rejection method, it likely needs a single iteration n = 5000; while true r = unique(1+rand(1,round(n*1.1))); p = le...

environ 4 ans il y a | 2

Charger plus