답변 있음
Check for equality in the contents of two arrays ignoring order
unique, setdiff, union and ismember call the function sort also internally. So % assert(isequal(sort(A), sort(B))) Is a very e...

10일 전 | 0

답변 있음
How to identify duplicate values in an n dimensional array , then club the linked values related to it in another array
A = [ 1 8 10 4; ... 1 8 4 0]; T = isMultiple(A); B = A(T) % ? or what do you want? A(T) = 0; functi...

11일 전 | 0

답변 있음
Iteration Involving 1x4 matrix
while abs(P - Pgiven) > 1e-6 ... end

11일 전 | 0

| 수락됨

답변 있음
Conversion to double from function_handle is not possible.
objective = zeros(1,3); % Here objective is a double for i = 1:Nc % And here you want to store a function handle in the d...

11일 전 | 1

답변 있음
Issues running a Mex Function (.mexw64)
The leading "./" means, that it is searching in the current folder. Assuming, that the current folder is chosen as expected, is ...

11일 전 | 0

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

13일 전 | 0

| 수락됨

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

14일 전 | 0

| 수락됨

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

14일 전 | 0

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

15일 전 | 0

| 수락됨

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

15일 전 | 0

| 수락됨

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

15일 전 | 0

| 수락됨

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

15일 전 | 1

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

15일 전 | 0

| 수락됨

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

16일 전 | 0

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

16일 전 | 0

| 수락됨

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

16일 전 | 1

| 수락됨

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

16일 전 | 0

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

16일 전 | 0

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

16일 전 | 0

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

16일 전 | 0

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

16일 전 | 0

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

18일 전 | 0

| 수락됨

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

18일 전 | 0

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

18일 전 | 0

| 수락됨

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

18일 전 | 0

| 수락됨

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

18일 전 | 0

| 수락됨

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

19일 전 | 0

| 수락됨

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

19일 전 | 0

| 수락됨

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

21일 전 | 1

| 수락됨

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

22일 전 | 2

더로드