Respondida
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 ...

más de 10 años hace | 1

| aceptada

Respondida
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.

más de 10 años hace | 0

Respondida
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 ...

más de 10 años hace | 1

| aceptada

Respondida
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...

más de 10 años hace | 0

| aceptada

Respondida
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 ...

más de 10 años hace | 0

Respondida
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 ...

más de 10 años hace | 1

Respondida
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 <...

casi 11 años hace | 0

Respondida
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))

casi 11 años hace | 0

| aceptada

Respondida
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...

casi 11 años hace | 0

Respondida
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...

casi 11 años hace | 1

| aceptada

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

casi 11 años hace | 0

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

casi 11 años hace | 0

Respondida
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.

casi 11 años hace | 0

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

casi 11 años hace | 0

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

casi 11 años hace | 0

| aceptada

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

casi 11 años hace | 1

Respondida
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...

casi 11 años hace | 0

Respondida
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...

casi 11 años hace | 1

Respondida
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

casi 11 años hace | 0

Respondida
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...

casi 11 años hace | 0

| aceptada

Respondida
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_...

casi 11 años hace | 0

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

casi 11 años hace | 0

Respondida
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...

casi 11 años hace | 0

Respondida
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 ...

casi 11 años hace | 0

| aceptada

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

casi 11 años hace | 0

Respondida
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]) ...

casi 11 años hace | 0

Respondida
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} =...

casi 11 años hace | 1

Respondida
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...

casi 11 años hace | 0

| aceptada

Respondida
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...

casi 11 años hace | 0

Respondida
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...

casi 11 años hace | 0

Cargar más