Réponse apportée
Execution of script nchoosek as a function is not supported
Please do that which nchoosek you must find somewhere similar to the above or this C:\Program Files\MATLAB\R2022a\toolbox\ma...

environ 4 ans il y a | 0

Réponse apportée
time date to datenum and datenum to datetime
I make a round conversion so you can convert any format to any other by using the appropriate substeps dt=datetime(2022,04,28,1...

environ 4 ans il y a | 1

| A accepté

Réponse apportée
Hello everyone.I'm new to the community, please help me to use matlab to calculate the volume of this 3D Shape
u=linspace(0,1,31); v=linspace(0,2*pi,37); [u,v]=meshgrid(u,v); x=(1-u).*(3+cos(v)).*cos(4.*pi.*u); y=(1-u).*(3+cos(v)).*sin...

environ 4 ans il y a | 2

| A accepté

Réponse apportée
VertCat unique rows of multiple tables.
% dummy test data Filename1=["a"; "b"; "c"]; Data1=["a1"; "b1"; "c1"]; T1=table(Filename1,Data1,'VariableNames',{'Filename','...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
how to multiply a curve (in a plot) by -1, if you do not have the original data? (I only have the plotted data.)
Plot your figure, you can then retrieve the data with x = get(findobj(gcf,'Type','line'), 'xdata') y = get(findobj(gcf,'Type',...

environ 4 ans il y a | 0

Réponse apportée
I am looking for a way to include duplicates into ismember function
Why use ismember at all (at least in that way)? O = Osw( interp1(a,1:length(a),y, 'nearest'))

environ 4 ans il y a | 1

| A accepté

Réponse apportée
How to calculate the width that contains 60% of the total area of peaks?
load Intensity.mat load position.mat ifun=@(x) interp1(x2,Int,x,'linear','extrap'); I0=integral(ifun,x2(1),x2(end)) x = fz...

environ 4 ans il y a | 0

Réponse apportée
Rotate an Ellipsoid towards a point
axlgt = [5,1,1]; P = [5;6;7]; [~,i] = max(abs(axlgt)); ei = accumarray(i,1,[3,1]); a=cross(P,ei); T=makehgtform('axisrota...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
How to find a permutation matrix to turn a general hermitian matrix into a block diagonal one?
A = [1, 0, 1; 0, 1, 0; 1, 0, 1], p=symrcm(A) A(p,p)

environ 4 ans il y a | 0

Réponse apportée
Matrix is singular, RCOND=NAN for a OLS regression
First make sure your data X and Y contain only finite elements (no NaN, Inf, or such). Instead of b = inv(X'*X) * X'*Y; try (...

environ 4 ans il y a | 1

Réponse apportée
Multiplying f(x) with f(-x)
For polynomial funtions with coefficients in P, f(x)*f(-x) is a polynomial as well with coefficients Q that can be computed like...

environ 4 ans il y a | 0

Réponse apportée
Eigenvectors not changing with constant parameter
"Could someone figure out the issue?" But there is no issue beside thet fact that you expect something that not going to happen...

environ 4 ans il y a | 0

| A accepté

Question


answer orange badge abadonned?
For active members, the little orange badge is no longer displayed and will be abandonned? My "Editor" badge disappears when m...

environ 4 ans il y a | 3 réponses | 0

3

réponses

Réponse apportée
Manipulating a multidimensional array.
Try this: kx = linspace(-0.5,0.5,15); ky = linspace(-0.5,0.5,15); [KX,KY] = meshgrid(kx,kx); alpha_R = 0.18851; M = lengt...

environ 4 ans il y a | 1

| A accepté

Réponse apportée
fminsearch error 'Argument 3 must be an options structure'
You need to create options using optimset function

environ 4 ans il y a | 1

| A accepté

Réponse apportée
Optimise comparing multidimensional matrices
I simply code by guessing what you have behind de scene. You better tell us exactly what are class/size of the variables in your...

environ 4 ans il y a | 1

| A accepté

Réponse apportée
Undefined function 'num2Str' for input arguments of type 'double'.
correct spelling is num2str with a lower-case "s"

environ 4 ans il y a | 0

Réponse apportée
i have a single row vector contains 0s and 1s and want to convert every 3 bits into integer how can i do that??
x=[0 1 0 1 1 1 ]; bin2dec(char(reshape(x,3,[])+'0')')

environ 4 ans il y a | 0

Réponse apportée
Pass m-function as parameter in m-function
Here is how you pass a function handle (it can be mfile, pfile, mexfile, appfile, anything that can run under MATLAB) func1(val...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
Convert a Column Vector to Matrix
x = [1 2 3 4 5 6] y = reshape(x, 2, [])'

environ 4 ans il y a | 0

Réponse apportée
How to slice an array across multiple dimensions with two limit arrays?
This should work X=rand(6,6,6); A=[1 2 3]; B=[6 5 4]; cidx = arrayfun(@(i1,i2) i1:i2, A, B, 'unif', 0); Y = X(cidx{:})

environ 4 ans il y a | 0

| A accepté

Réponse apportée
Function ISMEMBER indexes only the first value and leaves the rest
ismember returns in the first argument the logical array, not the index. If you want the firs index (idx will be empty if there ...

environ 4 ans il y a | 0

Réponse apportée
random bit to a block of some fix length?
x='01100010101001010100010001000001111111000101111' bl = 4; xb=x-'0'; % convert to binary array xb(end+(1:mod(-end,bl)))=0;...

environ 4 ans il y a | 1

| A accepté

Réponse apportée
Select elements of a matrix using an array (of indices)
A=[164 101 2733 2801 323 410 20 24 556 494 498 345 ...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
How to find a cross section of a 'Boundary' plot with non planar data?
Assuming the plane is z=0 (otherwise you should so a solid coordinates transformation to bring to this assumption) You have to ...

environ 4 ans il y a | 0

| A accepté

Réponse apportée
Finding change in direction
Your code will crash since indexing will be overflowed. Just an idea you might do the sign comparison of the entire array [r,...

environ 4 ans il y a | 0

Réponse apportée
Trying to understand the single-sided FFT
Multiplication by 2 for single side is just a convention. To me it doesn't have any solid backup. The convention is stated in pa...

environ 4 ans il y a | 1

Réponse apportée
Why is my if counter not working
Your for loop index is probably wrong, n should be scalar n = 1:2:10 ... for i = 1:n ... end or perhaps you want this ...

environ 4 ans il y a | 0

Réponse apportée
Create a matrix where every row adds to a number and within the matrix represents every possibility of the row combinations
A non recursive engine AllVL1 in FEX >> allVL1(4,3) ans = 0 0 0 3 0 0 1 2 0 ...

environ 4 ans il y a | 1

Réponse apportée
connect lines on scatter plot showing arrows
Try this quiver(xpre, ypre, xpost-xpre, ypost-ypre, 'off')

environ 4 ans il y a | 0

| A accepté

Charger plus