Answered

Convert 2-D array to multidimensional array

How about the function reshape? Take one column for example, Assume there is 126720 data. Make some changes for more columns. ...

Convert 2-D array to multidimensional array

How about the function reshape? Take one column for example, Assume there is 126720 data. Make some changes for more columns. ...

ungefär 8 år ago | 0

Answered

i had converted image into blocks. I converted blocks to linear array. Next i calculated mean values for first 8 arrays as given below. now i want to calculate values by using the formula: sum(linear array(:,1)-mean(:,1)).^2. please send code.

%After you have the array, you can try the function rms error = (rms(array))^2; %as descripted, sometimes rms is directly used...

i had converted image into blocks. I converted blocks to linear array. Next i calculated mean values for first 8 arrays as given below. now i want to calculate values by using the formula: sum(linear array(:,1)-mean(:,1)).^2. please send code.

%After you have the array, you can try the function rms error = (rms(array))^2; %as descripted, sometimes rms is directly used...

ungefär 8 år ago | 0

Answered

How to extract rectangular patches from a rotated rectangle?

% top figure % 1. edge finding, find the two parallel long lines % 2. use polyfit to fit the slope of the longer line % 3. d...

How to extract rectangular patches from a rotated rectangle?

% top figure % 1. edge finding, find the two parallel long lines % 2. use polyfit to fit the slope of the longer line % 3. d...

ungefär 8 år ago | 0

Answered

I have a CSV file with date and time values I want to import and convert to datetime

%After you have the strings of DateStrings, try the following formatOut = 'dd mmm yyyy HH:MM:SS AM'; t=datestr(datenum(DateSt...

I have a CSV file with date and time values I want to import and convert to datetime

%After you have the strings of DateStrings, try the following formatOut = 'dd mmm yyyy HH:MM:SS AM'; t=datestr(datenum(DateSt...

ungefär 8 år ago | 0

Answered

How can I insert a row in the middle of a matrix/vector?

% Here is a walkaround for this problem % 1. Define new vector Y based on existing vector x, Y = ones(length(x) + No.Of.N...

How can I insert a row in the middle of a matrix/vector?

% Here is a walkaround for this problem % 1. Define new vector Y based on existing vector x, Y = ones(length(x) + No.Of.N...

ungefär 8 år ago | 0

Answered

Finding nearest low match in array

bigger_value_location = find((f-val)>0); nearest = f(bigger_value_location(1)-1)

Finding nearest low match in array

bigger_value_location = find((f-val)>0); nearest = f(bigger_value_location(1)-1)

ungefär 8 år ago | 0

Answered

How to convert from cartesian coordinates to pixel indices on a 2D image

%I would suggest use the 'ceil' and 'floor' combination for pixels xs = xmid + round(ceil(radius * cos(phi))); ys = ymid +...

How to convert from cartesian coordinates to pixel indices on a 2D image

%I would suggest use the 'ceil' and 'floor' combination for pixels xs = xmid + round(ceil(radius * cos(phi))); ys = ymid +...

ungefär 8 år ago | 1

Answered

Adding trajectories to vector fields of a linear system

[x1, x2] = meshgrid(-.5:0.05:0.5, -.5:.05:.5); x1dot = - x1; x2dot = 2*x2; quiver(x1,x2,x1dot,x2dot) hold on s...

Adding trajectories to vector fields of a linear system

[x1, x2] = meshgrid(-.5:0.05:0.5, -.5:.05:.5); x1dot = - x1; x2dot = 2*x2; quiver(x1,x2,x1dot,x2dot) hold on s...

ungefär 8 år ago | 0

| accepted

Answered

Selecting an optimum value with 3 constraints

% 1 natural log both sides log_y = log(y); log_r = log(r); % 2 linear fitting to find best A and p values for known r and y....

Selecting an optimum value with 3 constraints

% 1 natural log both sides log_y = log(y); log_r = log(r); % 2 linear fitting to find best A and p values for known r and y....

ungefär 8 år ago | 0

Answered

compunding investment every month

X=[ 0.35; 0.05; 0.06 ;0.07]; x1 = 1+X; base = 100; y = base.*x1(1); for i = 2:length(X) y(i) = y(i-1)*x1(i)...

compunding investment every month

X=[ 0.35; 0.05; 0.06 ;0.07]; x1 = 1+X; base = 100; y = base.*x1(1); for i = 2:length(X) y(i) = y(i-1)*x1(i)...

ungefär 8 år ago | 0

| accepted

Answered

hello,how can i convert a gray level image to a binary image?

doc im2bw

hello,how can i convert a gray level image to a binary image?

doc im2bw

ungefär 8 år ago | 0

| accepted

Answered

Rain rate Calculating and plotting CCDF and percentage of time that the rain rate exceeded.

data = importdata('RainRate.txt'); day = data(:,1); mth = data(:,2); yr = data(:,3); time_hr = data(:,4); time_min =...

Rain rate Calculating and plotting CCDF and percentage of time that the rain rate exceeded.

data = importdata('RainRate.txt'); day = data(:,1); mth = data(:,2); yr = data(:,3); time_hr = data(:,4); time_min =...

ungefär 8 år ago | 0

| accepted

Answered

Set up graph before going into for loop, then refresh data in plot after each iteration

turn off the 'hold' "... %hold on; ... %hold on; ..."

Set up graph before going into for loop, then refresh data in plot after each iteration

turn off the 'hold' "... %hold on; ... %hold on; ..."

ungefär 8 år ago | 1

Answered

how to drw line y=m*x+b?

Maybe try m=0.00914; x0=641.4; b=17.1317; ezplot('0.00914*x+17.1317', [0 1000]) hold on, plot(x0, m*x0+b,'ro') axis tight ...

how to drw line y=m*x+b?

Maybe try m=0.00914; x0=641.4; b=17.1317; ezplot('0.00914*x+17.1317', [0 1000]) hold on, plot(x0, m*x0+b,'ro') axis tight ...

ungefär 8 år ago | 0

Answered

what is mistake in my matlab code

i think maybe your loop never finishes.... endlesss loop in the 'Ibranch' k = 1; while k<=nbr % k run in the number of b...

what is mistake in my matlab code

i think maybe your loop never finishes.... endlesss loop in the 'Ibranch' k = 1; while k<=nbr % k run in the number of b...

ungefär 8 år ago | 0

| accepted

Answered

How to I convert this to a 2d array?

Maybe can try the function plot3 instead of contourf. f=importdata('68 data set.txt'); x = f(:,1); y = f(:,2); z = f(:,3); ...

How to I convert this to a 2d array?

Maybe can try the function plot3 instead of contourf. f=importdata('68 data set.txt'); x = f(:,1); y = f(:,2); z = f(:,3); ...

ungefär 8 år ago | 0