Réponse apportée
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 ...

plus de 10 ans il y a | 1

| A accepté

Réponse apportée
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.

plus de 10 ans il y a | 0

Réponse apportée
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 ...

plus de 10 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
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 ...

plus de 10 ans il y a | 0

Réponse apportée
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 ...

plus de 10 ans il y a | 1

Réponse apportée
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 <...

plus de 10 ans il y a | 0

Réponse apportée
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))

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 10 ans il y a | 0

Réponse apportée
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...

plus de 10 ans il y a | 1

| A accepté

Réponse apportée
How can i randomly move the values of a vector
X = X(randperm(numel(X));

plus de 10 ans il y a | 0

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

plus de 10 ans il y a | 0

Réponse apportée
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.

plus de 10 ans il y a | 0

Réponse apportée
Loading data from a dat file without headers
Use textread with 'headerlines', 10.

plus de 10 ans il y a | 0

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

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
Can everyone help me to correct my code?
There is no plot command plot(rp, tp)

plus de 10 ans il y a | 1

Réponse apportée
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...

plus de 10 ans il y a | 0

Réponse apportée
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...

plus de 10 ans il y a | 1

Réponse apportée
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

plus de 10 ans il y a | 0

Réponse apportée
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...

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
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_...

plus de 10 ans il y a | 0

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

plus de 10 ans il y a | 0

Réponse apportée
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...

plus de 10 ans il y a | 0

Réponse apportée
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 ...

plus de 10 ans il y a | 0

| A accepté

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

plus de 10 ans il y a | 0

Réponse apportée
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]) ...

plus de 10 ans il y a | 0

Réponse apportée
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} =...

plus de 10 ans il y a | 1

Réponse apportée
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...

plus de 10 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 10 ans il y a | 0

Réponse apportée
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...

plus de 10 ans il y a | 0

Charger plus