Beantwortet
Create a new variable when conditions are met
temp = [10 2; 20 2; 30 1; 40 2; 50 1; 60 3]; G = temp(temp(:,2) == 2, :); M = temp(temp(:,2) == 1, :); If you like to ...

fast 11 Jahre vor | 1

| akzeptiert

Beantwortet
Convert array initialization code
You're right, the code adds a zero in front of vector v or a zero column if v is a matrix.

fast 11 Jahre vor | 0

Beantwortet
I there any built in tool in MATLAB that perform Principle Component Analysis?
Matlab's PCA is called princomp You can find out using lookfor principal Which results in my system in ...

fast 11 Jahre vor | 1

| akzeptiert

Beantwortet
Undefined variable "handles"
The variable 'handles' is not known inside your function set_row. You have to define set_rows with an additional parameter 'hand...

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
Extracting values from incomplete matrix set
Just check if the file exist before loading rank1 = nan(155, 2); % preallocate for speed for k = 1:2 for j = 1:155 ...

fast 11 Jahre vor | 0

Beantwortet
Why does MATLAB display font type "Helvetica" differently on Linux OS?
There is some art and science involved in how a font is displayed best on a monitor, a process known as hinting. Different OS ...

fast 11 Jahre vor | 1

Beantwortet
How do you save while loop output in a vector?
You don't have to introduce Hc or Fc; the data are already stored in F and H, as in the following example t = 1; while t <...

fast 11 Jahre vor | 0

Beantwortet
Easily working with numerical data in a cell array
A{1} = rand(12,2); A{2} = rand(10,2); b) B = cell2mat(A'); a) plot(B(:,1), B(:,2))

fast 11 Jahre vor | 0

| akzeptiert

Beantwortet
Plot Matrix with 3 columns
The mistake is that your script contains only comments, but no commands. It should read % Auto-generated by MATLAB on 22-Jul...

etwa 11 Jahre vor | 0

Beantwortet
To run a function
You can call a function w/o the square brackets in front, but then you only get the first return value in ans, as David explaine...

etwa 11 Jahre vor | 1

| akzeptiert

Beantwortet
How can i randomly move the values of a vector
X = X(randperm(numel(X));

etwa 11 Jahre vor | 0

Beantwortet
Merging files with different dimensions
You can reshape T into a 3D matrix of size 10x 6480x 33: T = reshape(T, 10, 6480, 33);

etwa 11 Jahre vor | 0

Beantwortet
I try to apply fuzzy c mean clusturing for landsat 8 image. I want to apply for a rgb image. This code can only apply to the one band.. How can apply this code for all bands.
Write a function that runs the code in one band: Y = fuzzycmc(I); and call this function for every band.

etwa 11 Jahre vor | 0

Beantwortet
Loading data from a dat file without headers
Use textread with 'headerlines', 10.

etwa 11 Jahre vor | 0

Beantwortet
How to remove rows in a multidimensional matrix?
for k=1:size(A,3) Ak = A(:,:,k); B(:,:,k)= Ak(sum(Ak')~=0,:); end

etwa 11 Jahre vor | 0

| akzeptiert

Beantwortet
Can everyone help me to correct my code?
There is no plot command plot(rp, tp)

etwa 11 Jahre vor | 1

Beantwortet
colon operator rounding problem
Use a = linspace(0, 120, 1201); But in general don't use a(20) == 1.9 but abs(a(20) - 1.9) <= eps If yo...

etwa 11 Jahre vor | 0

Beantwortet
Extracting near constant elements from an array
First who have to define an formal criterion of what you consider "near constant". For example, more than 20 points that vary my...

etwa 11 Jahre vor | 1

Beantwortet
How do i get index of a closest value from an array?
N = round(max(a)/900); for i = 1:N, [~, ind(i)] = min(abs(a - 900*i)); end

etwa 11 Jahre vor | 0

Beantwortet
How to add multiple axes to a log-log plot?
You have to set the xscale and yscale property of ax2 to 'log': x1 = 1:1000; y1 = x1.^2; x2 = 2*x1; y2 = y1; lo...

etwa 11 Jahre vor | 0

| akzeptiert

Beantwortet
i am geeting an error as "??? Input argument "int_H" is undefined.
You have to evoke the function with argument in the same order as you have defined the function. You define the function with H_...

etwa 11 Jahre vor | 0

Beantwortet
How to add multiple axes to a log-log plot?
See http://www.mathworks.com/matlabcentral/answers/54258-plotting-two-loglog-y-axes

etwa 11 Jahre vor | 0

Beantwortet
How to fix a bug with 'sum' function?
Check which sum at the start of your script and immediately before the line that generates the error. Must always be 'bu...

etwa 11 Jahre vor | 0

Beantwortet
how will be mean brightness of color image will be formulated in matlab
If you have an Lab image as a 3D matrix with planes L, a, b, just use meanbrightness = mean2(Lab(:,:,1)) If you have an ...

etwa 11 Jahre vor | 0

| akzeptiert

Beantwortet
how to correct thismistake
Check whos Route n = length(Route) BTW, if you need just one value, you can use randi(n, 1)

etwa 11 Jahre vor | 0

Beantwortet
Is there a way to use a median style filter to reduce spikes over a certain amplitude?
HR=[136 137 138 140 141 142 143 143 144 144 145 146 160 144 143 143 142 143 143 144 145 146 145 148]; dHR = diff([HR(1) HR]) ...

etwa 11 Jahre vor | 0

Beantwortet
How to find common centroids?
I is not exactly clear to me what you want to achieve. To order C depending on distance to the mean: C{1} = []; C{2} =...

etwa 11 Jahre vor | 1

Beantwortet
Scanning folder for files and using specific function for each of them.
1) filename1 = listSmartPhone1(i).name; 2) n = sscanf('2015-06-13_08-38-21.csv', '%d-%d-%d_%d-%d-%d'); 3) fu...

etwa 11 Jahre vor | 0

| akzeptiert

Beantwortet
store data in matrix
Growing matrices slow down your program, so preallocate M: Nhours = 7; M = ones(Nhours*3600, 9); Have a look at it's s...

etwa 11 Jahre vor | 0

Beantwortet
Is it possible to plot the ticks but not the axes?
No, but you can draw a white line on top of the axes. Or you can use my function onlyticks function onlyticks %ONLYTI...

etwa 11 Jahre vor | 0

Mehr laden