Community Profile

photo

Jan


Last seen: Today Active since 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.

Statistics

All
  • Grand Master
  • Revival Level 4
  • Promoter
  • Commenter
  • Explorer
  • Personal Best Downloads Level 4
  • Editor's Pick
  • First Review
  • 5-Star Galaxy Level 5
  • First Submission
  • 36 Month Streak
  • Thankful Level 4

View badges

Content Feed

Answered
Why doesn't my function for writing a file work?
"Not enough input arguments" might mean, that you call this function without inputs. Therefore the most important part of the co...

ungefär 10 timmar ago | 0

| accepted

Answered
Too many for loops, how to approach rearranging arrays problem differently?
Pre-allocate the output and avoid repeated calculations: a = 1:50; b = 10:50; tic aa = f2(a); bb = f2(b); for i = 1:le...

en dag ago | 0

Answered
I didn't know how to find r
a = 6 * 18 * 18 a = 4 * pi * r.^2 r = sqrt(6 * 18 * 18 / (4 * pi))

en dag ago | 0

Answered
Estimate the Value of Pi
Your code runs fine and it is clean. It can be simplified, but the application of the index a is valid. I'm not sure why your te...

2 dagar ago | 0

| accepted

Answered
Dot indexing is not supported for variables of this type - ISSUE?
Start with experimenting: img2 = reshape(img, [4, 376, 672]); rgb = permute(img2([3 2 1], :, :), [2, 3, 1]); figure, image(r...

2 dagar ago | 0

Answered
Remez exchange Algorithm for approximation
if a <= M < x(2) if v(end-1)< M <= b if i < M < i+1 These commands will not do, what you want. The comparison is evaluated fr...

3 dagar ago | 0

| accepted

Answered
Not enough Input arguments
Stephen hits the point: >>qardlecm This shows, that you call the function without input arguments. Perhaps you start it by cli...

3 dagar ago | 1

Answered
My "plot" has some problems
Did you update the graphic drivers and install all updates of Matlab? Try different graphic modes: opengl software opengl har...

3 dagar ago | 0

| accepted

Answered
Need matrix or vector with 1,0,1,0,1,0.........
Do you now the colon operator already? a = 2; b = 15; a:b a:3:b You can use this to create an index of the values, you want...

3 dagar ago | 0

Answered
Maximizing along n-1 dimensions of an n-dimensional array without a for loop
VV = rand(8, 9, 10); for ii = 1:size(VV,1) Vtemp = squeeze(VV(ii, :, :)); [V(ii), I(ii)] = max(Vtemp(:)); end ...

3 dagar ago | 0

| accepted

Answered
convert BGRA8 image format to RGB format
Do you have the pixels values as UINT8 array already? Then: RGB = BGRA8(:, :, [3, 2, 1])

3 dagar ago | 1

| accepted

Answered
A function that counts the number of zeros in a vector
Beside sum(D == 0) nnz(D) This would be working also, if the elements are 0 or 1 only: numel(D) - sum(D)

3 dagar ago | 0

Answered
matrix array for loop
See the command: size() https://www.mathworks.com/help/matlab/ref/size.html By the way, you find such commands, when you know ...

3 dagar ago | 0

Answered
Reading visual basic code language like matlab?
There is no direct translation from Visual Basic code to Matlab code. The solution is to learn a programming language, if you wa...

3 dagar ago | 0

Answered
Does Matlab initialize random seed at each -batch run?
Yes, exactly as you observe the random number generator is initialized with the same seed. Use rng to get different seeds. See:...

3 dagar ago | 0

Answered
How to maximize the graph area in case of subplots ?
There is a bunch of solution in the FileExchange. Search for "subplot": https://www.mathworks.com/matlabcentral/fileexchange?q=...

4 dagar ago | 0

Answered
Equivalent of numpy.where() value choice parameters
Your code looks almost fine: x = 0:9 y = (0:9) * -0.1 z = zeros(size(x)); z(mod(x, 2) == 0) = x(mod(x,2) == 0); % ...

5 dagar ago | 0

| accepted

Answered
Understanding coding terminology - indexing
"Indexing" means to address an element of an array by using an index. Example: x = [3,1,4] index = 2 x(index) % reply: 1 T...

5 dagar ago | 0

Answered
calculation norm divided by square root of data length
r = [-33.1869365513747 - 7.19942077700726i 9.95754431609273 - 9.07572996519880i 5.11935460162031 - 9.45713125754552i 17.24067494...

5 dagar ago | 0

| accepted

Answered
How to filter out the elevation higher than 0
I do not see, where your filter out elevations greator 0. It is faster to call interp2 with vectors as coordinates. So avoid ca...

5 dagar ago | 0

| accepted

Answered
Alternatives for dir command
addpath \\winfs\data\prod\maprod\arkivering\TAF; Why do you append this folder to Matlab's path? Are the files stored in this f...

5 dagar ago | 0

| accepted

Answered
Multiplication between elements of two different cells
"first 36 row of F will be multiplied by the first row of T and next 36 row of F will be multiplied by second row of T and conti...

7 dagar ago | 0

| accepted

Answered
How to solve error "merge_sort: failed to get memory buffer"
This sounds like your memory is exhausted. Are you running out of RAM?

7 dagar ago | 0

| accepted

Answered
Dynamically change .txt file name in MATLAB, COMSOL simulation
fname = sprintf('Results_E_Field_Iter%d.csv', iter); file = fullfile('/Users/marissawhitby/Desktop/C:\Users\jmw\Desktop\Output...

8 dagar ago | 1

| accepted

Answered
repeat vector elements and operate on them
Start with a simple loop: A = [12; 10; 5]; B = [4; 3; 2]; RepSum(A, B) function C = RepSum(A, B) len = sum(B); C = zer...

9 dagar ago | 2

Answered
Will this computer run Matlab?
Yes, of course. This is a powerful computer. It depends, on what you want to compute. If a model does not match into the RAM, m...

9 dagar ago | 0

| accepted

Answered
Publishing an mfile including the calls to other m files.
Does this help: https://www.mathworks.com/matlabcentral/fileexchange/33476-publish-dependent-and-called-functions ?

9 dagar ago | 0

Answered
I can`t solwe gauss elimination method
I've simplified the code and converted it from Octave to Matlab: A = [ -3 6 -1 -2; -3 3 -3 1; -1.5 4.5 -2.5 -0.5; 0 1.5 -0.5 -3...

9 dagar ago | 0

| accepted

Answered
Arrays have incompatible sizes for this operation.
Use the debugger to identify the problem. Type this in the command window: dbstop if error and run the code again. When Matlab...

10 dagar ago | 0

| accepted

Answered
How its possible do define this function in Matlab?
Your funcion is almost correct. Just change && to & and consider the logical index time in the output. The problem in your case...

10 dagar ago | 1

| accepted

Load more