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

11 years ago | 0

| accepted

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

11 years ago | 2

Answered
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/...

11 years ago | 1

| accepted

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

11 years ago | 0

| accepted

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

11 years ago | 0

| accepted

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

11 years ago | 0

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

11 years ago | 0

| accepted

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

11 years ago | 0

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

11 years ago | 2

| accepted

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

11 years ago | 0

| accepted

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

11 years ago | 0

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

11 years ago | 5

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

11 years ago | 0

| accepted

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

11 years ago | 0

| accepted

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

11 years ago | 0

| accepted

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

11 years ago | 0

| accepted

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

11 years ago | 1

| accepted

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

11 years ago | 1

| accepted

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

11 years ago | 1

Answered
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

11 years ago | 0

| accepted

Answered
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; ...

11 years ago | 0

| accepted

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

11 years ago | 1

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

11 years ago | 0

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

11 years ago | 0

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

11 years ago | 0

| accepted

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

11 years ago | 0

| accepted

Answered
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

11 years ago | 1

| accepted

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

11 years ago | 0

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

11 years ago | 0

Load more