Réponse apportée
how to make the same length in the struct
s=struct('a',rand(5,1),'b',rand(3,1),'c',rand(6,1)) maxheight = max(structfun(@height,s)); padarrays = structfun(@(x) [x; ze...

presque 3 ans il y a | 2

Réponse apportée
Matrix and vector multiplication of size using a CPU is very slow. Using GPU is much quicker but I need a way around the size limitation.
"I thought, because I skim read (it's an age thing!) that gather transferred stuff from GPU to ordinary memory. I'm not convince...

presque 3 ans il y a | 0

Réponse apportée
Counting zeros which are lying between nonzero elements by considering consecutive zeros as a single element in a matrix
A=[1 0 1 1 1 0 0 1;0 1 0 1 1 0 1 0;0 0 1 0 0 0 0 0;1 0 1 1 0 0 1 1] max(sum(diff(~~A,1,2)==1,2)-~A(:,1),0) % If A is binary ...

presque 3 ans il y a | 0

Réponse apportée
generate array of Different random floating numbers in a specific range
" (1, 100) in MATLAB. randperm is creating integer, but I want float numbers , preferable with 1 decimal point. Like 20.1 , 34.2...

presque 3 ans il y a | 0

Réponse apportée
Counting zeros which are lying between nonzero elements by considering consecutive zeros as a single element in a matrix
Always helpful the old for-loop A=[1 0 1 1 1 0 0 1;0 1 0 1 1 0 1 0;0 0 1 0 0 0 0 0;1 0 1 1 0 0 1 1] [m,n] = size(A); count ...

presque 3 ans il y a | 0

Réponse apportée
Finding the first 1 in a binary set using optimization
You ask the same question several time. Without any other a priori knowledge, scan your array until 1 is meet. There is no mira...

presque 3 ans il y a | 0

Réponse apportée
Counting zeros which are lying between nonzero elements by considering consecutive zeros as a single element in a matrix
A=[1 0 1 1 1 0 0 1;0 1 0 1 1 0 1 0;0 0 1 0 0 0 0 0;1 0 1 1 0 0 1 1] d=diff(A~=0,1,2); [~,i,v]=find(d'); vl=zeros(size(A,1),1)...

presque 3 ans il y a | 0

Question


Slider (legacy) with no room to slide?
I would like to create a slider (legacy version) to select a whole number from 1 to a given n. For n >= 2 this is OK, the curso...

presque 3 ans il y a | 1 réponse | 0

1

réponse

Question


What functions need GPU support
Recently there are few posts about function that are not fully support gpuArray and could benefit from more intensive GPU suppor...

presque 3 ans il y a | 3 réponses | 1

3

réponses

Réponse apportée
Optimizing for speed. Moving skewness finder. Cumulative sum proving to be bottleneck.
Speed optimized code changes are: Vectorize for-loop Avoid padding 0 by treating the first "iteration" in separate code. Mutu...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Why does Matlab 2023a crash when running my code?
/home/matt/MATLAB-Drive/Lab/required_files/oms/supporting_files/code_thirdparty/TobiiPro.SDK.Matlab_1.6.2.36/lib/64/tobiiresearc...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Change zoom mouse cursor and mouse wheel zoom factor in R2019
My workwround solution % test zoom mouse scroll wheel accelerator close all plot(sin(linspace(1,10))) figh = gcf; % Do th...

presque 3 ans il y a | 0

Réponse apportée
Matrix and vector multiplication of size using a CPU is very slow. Using GPU is much quicker but I need a way around the size limitation.
I run your (slighly modified) code with xRange = 100 (EDIT) and get the finite result My config: R2023a, Windows 11, Laptop 32 ...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Faster three dimensional higher order interpolation?
You probably need to change an existing open interpolation code to use efficiently gpu arrays. The cubic methode is smooth meth...

presque 3 ans il y a | 0

Réponse apportée
Optimization of a script
The v you compute is simply 132*b*(c-1) You want to optimiza it? Take b=Inf and c=Inf

presque 3 ans il y a | 1

| A accepté

Réponse apportée
Efficient searching to find the first element of an array meeting a condition
just fo the obvious for loop for i = 1:length(x) if expensive_check_for_meet_condition(x(i)) ifind = i; ...

presque 3 ans il y a | 2

Réponse apportée
Automatically set number of outputs of the gradient function
A = rand(10,10,10); % This works for any dimensions of A if isvector(A) % EDIT N = 1; else N = ndims(A); % 3 in t...

presque 3 ans il y a | 1

| A accepté

Question


How to check if an object is NaN
I want to check a generic object "is equal" to NaN. The command isnan(object) throws an error and the command isequal(object, N...

presque 3 ans il y a | 1 réponse | 0

1

réponse

Réponse apportée
Why result of conv and point wise multiplication has different result?
You have at least 2 errors in your codes The convolution by for-loop needs to flip the kernel (Morlet) The MATLAB convolution ...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Runge-Kutta with a function that changes at each time step
Again everything is written in the doc of ode45 "For information on how to provide additional parameters to the function odefun,...

presque 3 ans il y a | 0

Réponse apportée
Using Runge-Kutta in Matlab
" I can calculate an arbitrary velocity f(x,t) from the forces acting on a position x." Good this is a very good starting point...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
Extract rows from a matrix considering continuous numbers in the first column
For multiple values of rmax (in a vector) matrix = ... [59 1 2 3 1899 % I invent it 60 210 96 92 398 62 33...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
How can I implement these for loops efficiently using covolution?
Use conv x = (0:0.2:5).^2; L = 3; delta = rand; T = rand; % Your method xSinc = zeros(size(x)); for xx = 1:length(x) ...

presque 3 ans il y a | 1

Réponse apportée
Plot multiple data sets fast - fastest/latest/efficient method up to R2023a
@Florian Berzsenyi Is is possible and viable to preallocate all lines first, and then call drawnow expose? Yes. Note the I pe...

presque 3 ans il y a | 0

Réponse apportée
elements >0 are present in matrix only once
a= [3 5 9 12 0 0 0 0 4 6 7 8 10 11 0 0 15 17 18 19 ...

presque 3 ans il y a | 0

| A accepté

Réponse apportée
ismembertol second output specification
Here is my though on what index ismembertol returns. It is the first index that A belong after rearrange B by dictionary like s...

presque 3 ans il y a | 0

Réponse apportée
Memory required for struct array
The function structbase_bytesize_fun that computes the "base" memory of the struct s is as following: fieldname_bytesize = name...

presque 3 ans il y a | 0

Question


Memory required for struct array
In this answer https://www.mathworks.com/matlabcentral/answers/2010767-struct-function-in-matlab Walter Roberson gives some num...

presque 3 ans il y a | 1 réponse | 0

1

réponse

Réponse apportée
The least square with changing number of lines of matrix
A = rand(24,6); % your full matrix b = rand(24,1); % your measurements % which data you want to remove? removeidx = [1 4 24...

presque 3 ans il y a | 0

Réponse apportée
ismembertol second output specification
@Steven Lord "use the form at the bottom of the documentation page" Do you mean clicking on the rating with "stars"? If yes I j...

presque 3 ans il y a | 1

Charger plus