Réponse apportée
How do I include or make a discrete variable for an optimization problrm?
To restrict x1 to { 2, 5, 7, 8 } You might make slack variables x1 = 2 + 3*y1 + 2*y2 + 1*y3; with constrants y1, y2, y3 inte...

plus de 2 ans il y a | 0

Réponse apportée
Proper way to call designfilt for filtfilt
@Paul I have a question, you select the original phase for sqrtVfreq sqrtVfreq = sqrt(abs(Vfreq)).*exp(1j*angle(Vfreq)); Is it...

plus de 2 ans il y a | 0

Réponse apportée
Collaborative work environment in app designer
We are not working with App Designer but with GUI, and we have the same issue, there is np way to merge or rebase correctly dif...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Can I use a Matlab function as a callback of a C library when using loadlibrary and calllib ?
No MATLAB function are propritary and cannot directly inferfacing with anything (else). You have to wrap it in appropiate interf...

plus de 2 ans il y a | 1

Réponse apportée
How to find the matlab interp1 computational complexity?
If N is the number of data points (x, y), M is the query points (xq) interp1(x, y, xq, ...) has complexity of O(M*log(N)) for ...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Generate all possible permutations including repeats
F = [0,1,2]; combinations(F,F,F)

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Creating equidistant point on a 2D boundary plot
Check out https://www.mathworks.com/matlabcentral/fileexchange/34874-interparc

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
Related to finding columns of a matrix satisfying specific conditions
% Generate a test matrix X = rand(8, 500); X(:,10) = [0 0 3 0 5 0 0 0]; X(:,20) = [0 0 0 0 5 0 0 0]; % won't be detected si...

plus de 2 ans il y a | 0

Réponse apportée
Matlab crashes with large matrix
For 1e6 column the memory required in Gb for one array is memgGb = 1e6*12e3*8 / 1e9 And you have the cell array + the concaten...

plus de 2 ans il y a | 1

Réponse apportée
Efficiently calculating the pixels crossed by a ray bundle
I only add an altervative to the for-loop at the end. On my PC the runtime if about 10 time faster. %all of this is usually su...

plus de 2 ans il y a | 0

| A accepté

Question


Proper way to call designfilt for filtfilt
The command designfit is used to design a filter with user high level specification of the response funtion. The result of desig...

plus de 2 ans il y a | 2 réponses | 0

2

réponses

Réponse apportée
Minimize multivariable function with multivariable nonlinear constraints in MATLAB
x0 = [0;0;0;0;0;0]; x = fmincon(@mycost,x0,[],[],[],[], [],[],@mycon) function f = mycost(x) f = (x(1)*x(3)*cos(x(4))); en...

plus de 2 ans il y a | 1

Réponse apportée
Quick method in solving symmetric linear equation
If your S is sparse you should look at iterative methods. For symmtric case it is recommended to use pcg. To take further advant...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Multiply slices of 3D matrices without duplicating in memory
This would do m = 100; n = 10; S=rand(m,n,n); W=rand(n,n,n); X=pagemtimes(S,reshape(W,[n n 1 n])); X=reshape(X,[m n n^2]...

plus de 2 ans il y a | 0

| A accepté

Question


Unexpected result using cellfun with 'size' as first argument on string array
The title of the topic says it all, but here is the result I would not expected. Is this behaviour intended? or is it a bug? s...

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

1

réponse

Réponse apportée
why does not "pchip" requires derivative values as input
Since the derivatives are computed internally as with general polynomial picewise functions. It satisfies : interpolation on ...

plus de 2 ans il y a | 0

Réponse apportée
What frustrates you about MATLAB? #2
The function combinations returns a table instead of standard array.

plus de 2 ans il y a | 0

Question


Error "Method 'Control' is not defined for class 'matlab.graphics.controls.internal.Control'"
fig = figure('Name', 'test'); t = tiledlayout(fig, 4, 4); The latest instruction throw this strange error on one of my...

plus de 2 ans il y a | 3 réponses | 0

3

réponses

Réponse apportée
Issue with optimizing vectorized code with logical matrixes
My guess is that you run into memory problem. During the assigment gamma(loc#) = theta(loc#) There are perhaps 3 copy of a bi...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Whether Matlab is compatible with macOS?
https://www.mathworks.com/support/requirements/matlab-mac.html

plus de 2 ans il y a | 1

Réponse apportée
how velocize it? (vectorize it)
a=magic(8) b=[1 3 2 4 5 5 8 3] % (b is always >0) B = a.* ((1:size(a,1))' >= b)

plus de 2 ans il y a | 1

| A accepté

Réponse apportée
How to avoid unnecessary legends in the graph?
h=plot(t,TGN,t,T1N,t,ML1N,t,ML2N,t,ACN,t,EMSB1N,t,MFN,t,mainN); xticks([43200 129600 216000 302400 388800 475200]) xticklabels...

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Valid Shape FFT Deconvolution
You just do something that is obviously impossible. By FFT with truncation X = fft(x,L) You don't use the n-1 last elements s...

plus de 2 ans il y a | 0

Réponse apportée
Find maximum difference between two arrays
No need to compare all the pairs A = randn(1,101); B = randn(1,101); dmaxBruteForce = max(abs(A-B.'),[],'all') dmaxSma...

plus de 2 ans il y a | 1

Réponse apportée
How do I get largest distance between two rows in an nx3 matrix?
For euclidian distance, the largest distance must contain 2 points on the convex hull xy = randn(10000,2); K = convhull(xy); ...

plus de 2 ans il y a | 0

Réponse apportée
How to access struct member via a string
I made this for my own use. It is not a dot syntax, just the functional form. The constraint is that accessing nested subfield(...

plus de 2 ans il y a | 0

Réponse apportée
How to map two data sets on same xy coordinates for density-based comparison (hist3)?
Specify edges rather than (resolution) nbins https://www.mathworks.com/help/stats/hist3.html#d126e546264

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Shuffle order of cell array without repeating rows
This does not require any special structure of the input (such as number of elements; or groups, or cardinal of groups, or the o...

plus de 2 ans il y a | 0

Réponse apportée
Nested for loop - adding elements to a matrix
Try this modification EEG_NofSC = zeros (Nchannels,Nepochs); % move outside the outer loop for iNepochs = 1 : Nepochs ......

plus de 2 ans il y a | 0

| A accepté

Réponse apportée
Error: Warning: Matrix is close to singular or badly scaled. Results may be inaccurate.
N=30; % compute the chebyshev differentiation matrix and x-grid Ly =3; eta_ygl = 2/Ly; etagl = -cos(pi*(0:N)/N)'; ygl = ...

plus de 2 ans il y a | 0

Charger plus