문제를 풀었습니다


Back to basics 6 - Column Vector
Covering some basic topics I haven't seen elsewhere on Cody. Given an input vector, output true or false whether it is a colu...

대략 12년 전

답변 있음
PLEASE EXPLAIN The SUM operation on an (L,M,N) array returns a (1,M,N) array. CODE THAT FOLLOWS IS AS WRITTEN gray_average_2d(1:m,1:n) = gray_average(1,1:m,1:n); ?
It is because you asked for a single slice in a 3D array. This might help you A = reshape(1:(2*3*4),2,3,4) ; % 3D test data...

대략 12년 전 | 0

답변 있음
is there any way to draw a vertical and horizontal line that pass through blobs centroid ?
Here is one approach: s = regionprops(binaryImage, 'centroid'); centroids = cat(1, s.Centroid); columndata = ...

대략 12년 전 | 0

답변 있음
How To Separate each matrix column values with comma?
using semi-colons in concatenation will put elements in columns, while using comma's will put them in rows. You can often omit t...

대략 12년 전 | 0

답변 있음
Error using fprintf in fopen
Always check the value of fid after a call to _fopen_ to see if it is valid: [fid, message] = fopen('latest.txt','wt') ; ...

대략 12년 전 | 0

답변 있음
How can I convert every floating value in cell to integer?
Two step approach for mixed cell arrays C = {(1:10)/3, 'hello',[pi exp(1)]} tf = cellfun(@isnumeric,C) % which cell ...

대략 12년 전 | 0

답변 있음
How do i use eval function when the sentence has apostrophe (') in it?
This is one of the reasons you should *not* use eval: eval(char('fkur*)Ykvj"GXCN"{qw"pgxgt"mpqy"yjcv"jcrrgpu0"Kv"eqwnf"jcx...

대략 12년 전 | 2

답변 있음
Use cellfun instead of for loop
The way to approach this is # create a function that acts on the contents E of a single cell # apply that function to each ...

대략 12년 전 | 1

답변 있음
How to change the variable name in the loop
These kind of problems can be easily avoided using another approach In pseudocode: data(1).values = ... data(2).valu...

대략 12년 전 | 1

답변 있음
How do i use eval function when the sentence has apostrophe (') in it?
An apostrophe, or rather a single quote as it is called, in a string can be accomplished by doubling it, like in: str = 'it...

대략 12년 전 | 2

| 수락됨

답변 있음
how to use index referencing ?
Assuming A and X are your input arrays szA = size(A) B = zeros(szA) [minA,Rix] = min(A,[],1) % minimum value per co...

대략 12년 전 | 0

답변 있음
How to sum only the positive elements in a series?
This piece of pseudocode might get you started: while CurrentSum < maxixumSum n = n + 1 CurrentValue = (-1^n...

대략 12년 전 | 0

답변 있음
Create matrix from two arrays using colon
I do not see why you have to specify the last values, since it is always the same number more than the starting values. If that ...

대략 12년 전 | 0

답변 있음
Numerical precision of matrix multiplication (inconsistent results with colon indexing)
Strange! Also strange: rng(1) ; A = randn(100,3) ; B1 = A'*A B2 = mtimes(A',A) disp(['B1 == B2 : ' '0'+isequa...

대략 12년 전 | 0

답변 있음
I want to compute histogram for a tif image. But the regular histogram code does not accept my input. so please give me a solution
Apparently your array *originalImage* is not 2D. You can probably see that ndims(originalImage) will return 3, sugge...

대략 12년 전 | 0

답변 있음
looking for a function similar to mapminmax
A = ceil(10*rand(4,4)) % example data A = A - min(A(:)) % map minimum value of A to 0 (thereby changing the maximum) ...

대략 12년 전 | 0

답변 있음
how to build a new matrix with reference to the index of another matrix ?
MM = min(cost,0) RR = cost<0 btw, the notation _cost(i,j)_ means the element in the i-th row and j-th column of the arr...

대략 12년 전 | 1

질문


It is not working / it gives an error
Just curious: What if you replace " _Matlab_ " by " _The World_ ", how would God (if any?) react to these kinds of remarks?

대략 12년 전 | 답변 수: 1 | 0

1

답변

답변 있음
How to change the amount of the histogram?
I will spell it out for you, provided that you ** read the documentation **, ok? % let X be your image with values between ...

대략 12년 전 | 0

답변 있음
Shuffling a cell array
If you intend to randomise the order of the elements of an array A, try this A = [10 20 30 40 50 60] A_shuffled = A(ran...

대략 12년 전 | 3

답변 있음
regexp to match certain words in a string
Here is how: WORDS = {'MassDensity', 'Mobility', 'ThermalConductivity'} IDX = regexp(str, WORDS) % IDX{k} ho...

대략 12년 전 | 1

답변 있음
Summation in a for loop without cumulitive
Another solution: % hide the for-loop % A is the array, B is a scalar A = randperm(10) B = 2 C1 = arrayfun(@(x)...

대략 12년 전 | 0

답변 있음
is it possible to get index of reshaped matrix
A short story of LINEAR vs. SUB indexing: A = [22 33 44 55 66 77] B = reshape(A,2,[]) numel(A),numel(B) % the ...

대략 12년 전 | 2

답변 있음
how to get the values of each cell in the cell array?
The code below acts on a cell array C. Each element of C is an array of numbers. The anonymous function given to cellfun subtrac...

대략 12년 전 | 0

답변 있음
How can I change the gridline color without changing the tick and tick label colors in MATLAB?
People might be interested in creating their own grid using my GRIDXY(https://www.mathworks.com/matlabcentral/fileexchange/9973-...

대략 12년 전 | 0

답변 있음
How to change the amount of the histogram?
use *HISTC* to specify the bins

대략 12년 전 | 0

답변 있음
making column of zero matrix equal to one based on another matrix
Perhaps you want to set in a row K of A, the entry in column B(k) to one? %data A = zeros(3,3) B = [3; 1; 2] ...

대략 12년 전 | 0

| 수락됨

답변 있음
I am trying to randomly disperse different numbers in MATLAB array:
V = ones(1,10) V(1:4) = 2 V(5:6) = 3 V = V(randperm(numel(V))) % randomize the order initially % change...

대략 12년 전 | 1

| 수락됨

답변 있음
Determining which values are found in all columns of an array
Assuming you matrix is a cell array: % create some example data CVFun = @(n) ceil(10*rand(n,1)) ; % helper function to c...

대략 12년 전 | 0

| 수락됨

답변 있음
Find length of contiguous numbers in a vector that sum to a given value
You can get rid of the slow CONV statement by using the sum of K consecutive elements in creating the sum of K+1 consecutive ele...

대략 12년 전 | 1

더 보기