Respondida
reducing an angle from 30 degree to 20 degree and increasing angle form 280 degree to 20
You can use my function angdiff to compute the angular difference. Note that the angles have to be given in rad; rad = deg/180*p...

alrededor de 11 años hace | 0

| aceptada

Respondida
How to use MATLAB histogram & histcounts functions for Double Datatype
The error message says that there is no histcounts function. Histcounts and histogram were introduced in R2014b. Maybe you have ...

alrededor de 11 años hace | 2

Respondida
Eliminating for-loops (compact notation?)
Oh, that's easy (just kidding): X = squeeze(abs(log(mean(imageArray_1, 1)./mean(imageArray_2,1)*imageNormalisationDivisor_2/...

alrededor de 11 años hace | 1

| aceptada

Respondida
Problems in order to concatenate a string with file extension at filename parameter of imwrite
You can use name_3_P1.avi

alrededor de 11 años hace | 0

Respondida
how to make a funcation that return smallest posible integer from series
You forgot to handle the -1 case: function out = one_per_n(x) total = 0; found = 0; for n = 1:10000 total = tota...

alrededor de 11 años hace | 0

| aceptada

Respondida
how to make a function that calculate consective difference of elements of a vector
Why not using your original solution with the changes that Yoav suggested, plus an additional abs() to get the _absolute_ differ...

alrededor de 11 años hace | 0

| aceptada

Respondida
How to resize an image into size 256*256
Use r = size(J, 1); c = size(J, 2); If J is a color image, c returns the columns*3. See also my answer to your first qu...

alrededor de 11 años hace | 0

Respondida
special kind of interpolation
This "interpolation" is basically a plot with values added where y is zero: x = x(:)'; y = y(:)'; % force row vectors ind ...

alrededor de 11 años hace | 0

| aceptada

Respondida
Solving Matrix Equations Using \
Because A has fewer rows than columns, the equation is underdetermined, that means that there is no unique solution, but multipl...

alrededor de 11 años hace | 0

Respondida
Conv two continuous time functions
The y-axis is too large to show the data. You can rescale them by, e.g., axis([1 8 -delta delta]) or with your code, use...

alrededor de 11 años hace | 2

| aceptada

Respondida
I want to create a curve on the histogram?
If you want to plot something on top of your histogram, use hold on plot(your arguments here) If you want to plot t...

alrededor de 11 años hace | 0

| aceptada

Respondida
How to divide an image into blocks and find the RGB values of each pixels in a block?
To get the i,j 32x32 block from an RGB image, use BL = I((i-1)*32+[1:32], (j-1)*32+[1:32], 1:3); to select the R,G,B pla...

alrededor de 11 años hace | 0

Respondida
How to use filled circles (dots) instead of empty circles in scatter plots?
scatter(rand(1,10), rand(1,10), 'o', 'MarkerFaceColor', 'b')

alrededor de 11 años hace | 5

Respondida
Can anybody help me the function adjcontrast() ?
h = imshow(yourimage); imcontrast(h)

alrededor de 11 años hace | 0

| aceptada

Respondida
How to assign the data to the header with units in square bracket.?
What about header.data = 1:4; header.label = 'accel [m/s²]';

alrededor de 11 años hace | 0

| aceptada

Respondida
Plotting 1/x correctly
Because you have not specified the x values in your plot, they run from 1 to the numel(s). So X is not an absolute value but the...

alrededor de 11 años hace | 0

| aceptada

Respondida
Extract a matrix out of another matrix with logiccal expression
F(F(:,1) >= 5, :);

alrededor de 11 años hace | 0

| aceptada

Respondida
Contour plot of Matrix
If you just have these 3x4 values, you can copy them to Matlab without reading the Excel file: A = [1 5 6 6 9 5 6 7 8...

alrededor de 11 años hace | 1

| aceptada

Respondida
Converting values to 0 and 1 and then counting occurrences!
A(A<20) = 0; A(A>0) = 1; cnt = sum(diff(A) == -1);

alrededor de 11 años hace | 1

| aceptada

Respondida
Create a vector with known indices and assign to that values from known vectors
var = [var1; var2; var3]'; ind = (positions - 1)*size(var, 1) + [1:numel(positions)]; final = var(ind)

alrededor de 11 años hace | 1

Respondida
how to do this Data analysis?
In the body of your for loop, write load(matFiles(k).name) plot(k, mean(C), '.') if k == 1, hold on, end

alrededor de 11 años hace | 0

| aceptada

Respondida
Smoothing plots in MATLAB
To generate a smoothed version xs of x, you can average over n elements, i.e., n = 3, with the following one-liner: n = 3; ...

alrededor de 11 años hace | 0

| aceptada

Respondida
How to cut the end of a string which follows a special character?
regexp('sahdklsjf_sdfs', '(^[a-zA-Z]*)', 'match')

alrededor de 11 años hace | 1

Respondida
I need 25 different numbers between 1 and 34 which will select 25 different cases in a switch. Any help would be greatly appreciated.
r = randperm(34); % all number from 1 to 34 in random order r = r(1:25); % 25 different numbers between 1 and 34 You can t...

alrededor de 11 años hace | 0

Respondida
How to perform a ttest assuming all values together?
You have to use anova1 if you have more than two samples.

alrededor de 11 años hace | 0

Respondida
How can I find and replace a pattern inside a matrix
The is the morphological operation 'erode' on black-and-white images. If you have the image processing toolbox, you can use ...

alrededor de 11 años hace | 0

| aceptada

Respondida
How can I plot multiple columns from multiple files using plot?
That's straightforward, given that D1 is your N*3 file plot(D1(:,1), D1(:,2:3)') hold on Load another data D2 plot...

alrededor de 11 años hace | 0

| aceptada

Respondida
Using a For Loop with the variable set to a series defined matrix values?
Have you tried this combination of brackets? ;-) for window = {1:64, 30:31, 21:29} windowval = cell2mat(window); end

alrededor de 11 años hace | 1

| aceptada

Respondida
Old Version Matlab on Mac
You have to install XQuartz and Apple Java 6: http://www.mathworks.com/matlabcentral/answers/103598-why-am-i-unable-to-launch...

alrededor de 11 años hace | 0

Respondida
Generate a weighted graph and an adjacency matrix from an image matrix
If you have a image matrix like 10 3 4 12 5 8 you could interpret it as an adjacency matrix of a directed graph a...

alrededor de 11 años hace | 0

Cargar más