답변 있음
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...

2년 초과 전 | 2

답변 있음
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...

2년 초과 전 | 0

답변 있음
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 ...

2년 초과 전 | 0

답변 있음
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...

2년 초과 전 | 0

답변 있음
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 ...

2년 초과 전 | 0

답변 있음
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...

2년 초과 전 | 0

답변 있음
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)...

2년 초과 전 | 0

질문


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...

2년 초과 전 | 답변 수: 1 | 0

1

답변

질문


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...

2년 초과 전 | 답변 수: 3 | 1

3

답변

답변 있음
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...

2년 초과 전 | 0

| 수락됨

답변 있음
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...

2년 초과 전 | 0

| 수락됨

답변 있음
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...

2년 초과 전 | 0

답변 있음
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 ...

2년 초과 전 | 0

| 수락됨

답변 있음
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...

2년 초과 전 | 0

답변 있음
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

2년 초과 전 | 1

| 수락됨

답변 있음
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; ...

2년 초과 전 | 2

답변 있음
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...

2년 초과 전 | 1

| 수락됨

질문


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...

2년 초과 전 | 답변 수: 1 | 0

1

답변

답변 있음
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 ...

2년 초과 전 | 0

| 수락됨

답변 있음
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,...

2년 초과 전 | 0

답변 있음
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...

2년 초과 전 | 0

| 수락됨

답변 있음
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...

2년 초과 전 | 0

| 수락됨

답변 있음
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) ...

2년 초과 전 | 1

답변 있음
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...

2년 초과 전 | 0

답변 있음
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 ...

2년 초과 전 | 0

| 수락됨

답변 있음
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...

2년 초과 전 | 0

답변 있음
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...

2년 초과 전 | 0

질문


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

2년 초과 전 | 답변 수: 1 | 0

1

답변

답변 있음
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...

2년 초과 전 | 0

답변 있음
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...

2년 초과 전 | 1

더 보기