Community Profile

# Jan

Last seen: Today 2009 이후 활성

It is easier to solve a problem than to guess, what the problem is.

Questions about FileExchange submissions are welcome - get my address from the code. I do not answer mails concerning questions in the forum.

All

배지보기

#### Content Feed

보기 기준

답변 있음
How can I create a set of N diagnal matrices range from diag(1, 1, ... , 1) to diag(-1, -1, ... , -1) for testing purposes?
z = repmat(eye(4), 1, 1, 16); z(z==1) = rem(floor((0:15) ./ [1; 2; 4; 8]), 2) * 2 - 1; Now z(:,:,i) is the i.th matrix.

30분 전 | 0

답변 있음
parfor slower than for
The main work in you example is the iterative growing of the array. This is a waste of time in sequential and parallel code. Pre...

약 2시간 전 | 0

답변 있음
To calculate the mean vector, covariance matrix, and correlation coefficient matrix of a RGB image. I have trouble getting the mean, cannot use the mean for matlab.
What do you expect this line to do: for i = l :length (img(:,:,1)) ? The length() command replies the longer dimension of the ...

약 2시간 전 | 0

답변 있음
large file slow running
I guess that the iterative growing of the array data slows down the processing. Remember that the growing of an array required ...

약 2시간 전 | 0

답변 있음
How to reduce data irregularly?

약 6시간 전 | 0

답변 있음
How to suppress anonymous function handle being created?
As usual the created variable is not shown, if you append a semicolon ; after the command. a = @(x) sin(x) % Output: b = @(y...

1일 전 | 1

답변 있음
Convert a jpg graph into matrix arrays
This is not possible. Saving the data with the low screen resolution to a jpeg removes the possibility to access the data in a h...

1일 전 | 0

답변 있음
removing some the elements in cell array
for k = 1:nunel(data_array) data_array{k} = data_array{k}(4:5); % or = data_array{k}(4:end); % Or: % da...

1일 전 | 1

| 수락됨

답변 있음
How do I pass a filename to a routine in Matlab's command window?
The error message is clear: The file does not exist. Although you assume, that the current folder is the same, this is not true....

1일 전 | 0

답변 있음
How to put uigetfile data from Pushbutton into Listbox?
I'm not sure what you want to achieve. With some guessing: function loadekstrak_Callback(hObject, eventdata, handles) % hObjec...

2일 전 | 0

| 수락됨

답변 있음
Performance difference between loop and recursion in fibonacci sequence
A cleaner version of your loop uses a pre-allocation of the output: function y = fibor_loop_2(n) y = zeros(1, n); % Pre-alloc...

2일 전 | 1

| 수락됨

답변 있음
Changing the range of for loop give different result
You cannot create a matrix, whose elements are matrices. This works with a cell array: A = cell(r+1, k+1); for i = 2:r+1 ...

2일 전 | 0

답변 있음
Matlab如何将cell中的矩阵进行合并？
R = {[3;2], [3;5], [4;2], [4;5], [5;2]}; nR = numel(R); f = true(1, nR); for iR = 1:nR if f(iR) ...

2일 전 | 0

답변 있음
separate strings that are inside a cell
Your description is not clear yet. I dare to guess: % Input (thanks Adam): C = {"sdfsd"; "dare"; ["abs";"ses"]; "erwe"; "serwe...

2일 전 | 0

| 수락됨

답변 있음
cd('E:/image_trans/Emis32_%d.bin'); This does not look like a valid folder name. Is there really a % character? Later on this i...

3일 전 | 0

답변 있음
Group values of a vector into new vectors according to magnitude
A = [17 323 100 3 278 220 45 351 212 51]; Y = discretize(A, [0, 50, 100, 360]) C = splitapply(@(x) {x}, A, Y)

3일 전 | 1

답변 있음
How to convert to a parallel program?
Pre-allocation is essential. Do not let array grow iteratively, but create them with the final size: n = 41; h = 1 / (n...

3일 전 | 0

답변 있음
How to select every 54th image in the folder?
A = 'D:\Your\A'; B = 'D:\Your\B'; AList = dir(fullfile(A, 'a*.jpg')); BList = dir(fullfile(B, 'b*.jpg')); nB = numel(BLis...

3일 전 | 1

답변 있음
Multiply cell by cell
Use a loop: for k = 1:numel(C_inside2) C_inside2{k} = C_inside2{k} .^ 2; end This is faster than cellfun: C_inside2 = ce...

3일 전 | 0

| 수락됨

답변 있음
How can I speed up (or avoid) a comparison in for loop?
What about omitting the loop: A(ismember(L, f)) = true; Or: LUT = [false, N < threshold]; A(LUT(L + 1)) = true;

3일 전 | 1

| 수락됨

답변 있음
This is not a trivial problem. In the general case it is a global optimization problem and there can be a huge number of equival...

3일 전 | 0

| 수락됨

답변 있음
Speed Up the for loop
Fmt1 = '%6.2f \t %6.4f \t %6.4f\t %6.2f \t %6.2f \t %6.2f \t %6.2f'; Fmt2 = '%s \t %6.2f \t %6.2f \t %6.2f \t %6.2f \t %6.4f \t...

4일 전 | 1

| 수락됨

답변 있음
Error while recording using audio recorder object
record_file=getaudiodata(recorder); ffname = sprintf('%s%s',record_file); getaudiodata replies a numerical array with the sign...

4일 전 | 0

| 수락됨

답변 있음
What should go in a next-generation MATLAB X?
A complete list of changes for each command. Currently we find "introduced in Rxy" already, but modifications of inputs and out...

4일 전 | 2

답변 있음
Avoid ode15s from freezing in parameter optimization
I've limite the time to [0, 15]. You see that one component explodes between t=15 and t=16. This let the step size of the integr...

6일 전 | 0

답변 있음
How increase calculate speed in for loop
Start with a simplification of the code: Depth = 5000; Num_Alines = 400; Num_Bscan = 300; Alines = 180 h ...

6일 전 | 0

답변 있음
How to add integers without correction?
a = int8(126); b = int8(2); tic for k = 1:1e4 c = bitadd1(a, b); end toc tic for k = 1:1e4 c = bitadd2(a, b);...

6일 전 | 1

답변 있음
Solving a System of ODEs using Euler's method
Your function to be integrated depends on t also. You call this x in the Euler method. At is easier to use vector equations: f...

6일 전 | 0

답변 있음
Matlab versions supported on Windows 11?
Windows 11 have not been officially released yet. We and MathWorks cannot know how the final version will work. There have been ...

6일 전 | 0

답변 있음
How to Copy Upper diagonal elements of matrix A into a new matrix.
A = [1 2 3 4; 2 1 3 4; 1 1 1 2; 1 0 0 1]; B = triu(A)

6일 전 | 0

| 수락됨