1|1|EL_1_BaDfG|4,41|5,1|6,99|8,76|9,27|13,88|14,19|15,91|19,4|21,48...

it means:

id|type|name|connected_to, weight|connected_to, weight| and so on..

And the taks is this:

The structure of the graph should have fields that represent the vertices array of structures , each of which represents a single node . Each of these structures has fields id , type, name , edges and possibly some additional fields that are required due to the specific time ( previousVertexId , weightFromStart ) . Edges is a series of structures that represent one branch each of these structures has fields endVertexId , status and eventual some specific fields to search for ( eg . Weight ) . Status field indicates the state of the switch , which can be 1 or 0. In the start, status is 1

I was trying to use fscanf function, but it only reads one whole line as one string. By using strsplit function i managed to separate those strings with delimiter |. How can I do the same for whole file and after that assign value to each edge(id, type,name,..)?

Best regards,

Dejan

]]>If there is anyone who can guide me or share some code of power allocation, sub-carrier allocation and channel capacity enhancement with me i will be thankful to him in advance.I am working on resource allocation of power line communication. ]]>

this is the code i m using. can someone tell me where i m wrong n how to fix it?

clear all

Video1 = VideoReader('C:\Users\User\Desktop\FYP\database\walking\person01_walking_d1_uncomp.avi');

for i=1:218

% keyboard

data(:,:,i)=mean(readFrame(Video1),3);

end

data = uint8(255 * mat2gray (data));

```
MHI = data;
% Define MHI parameter T
T = size(data,3)+20; % # of frames being considered; maximal value of MHI
% Load the first frame
frame1 = data(:,:,1);
% Get the dimensions of the frames
[y_max, x_max] = size(frame1);
% Compute H(x,y,1,T) (the first MHI)
fst = MHI(:,:,1);
fst(fst>0) = T;
MHI(:,:,1) = fst;
% start global loop for each frame
for frameIndex = 2 : size(data,3)
%fprintf('Loading frame Index %d\n',frameIndex);
% Load current frame from image array
frame = data(:,frameIndex);
frame_pre = MHI(:,frameIndex-1);
MHI(:,frameIndex) = frame_pre - 1;
% Set of all non-zero value to T
frame(frame > 0) = T;
[y,x] = find(frame > 1);
for i = 1 : size(y,1)
MHI(y(i,:), x(i,:), frameIndex) = frame(y(i,:), x(i,:));
end
end
figure, imshow(MHI(:,:,218), []);
```

]]>
where the coefficients |*a*| and |*b*| are to be read from a text file.

.

**I tried the following,**

```
function out = rosenbrock(x)
disp('rosenbrock()..........called');
coeff = load('coeff.txt');
a = coeff(1);
b = coeff(2);
xx = x(1);
yy = x(2);
out = (1 - xx + a)^2 + 100*(yy - b - (xx-a)^2)^2;
end
```

**But it is doing two things,**

(1) Slowing down the performance of the optimization.

(2) The output is also not correct (the optimization isn't converging).

**How can I solve this issue wile fulfilling my requirement?**

Is it possible to pass the values of |a| and |b| as the arguments of *|rosenbrockwithgrad()|*?

I have tried the following,

```
rosenbrockwithgrad_p = @(x)[rosenbrock(x, a, b);
(nargout > 1) * gradient(x)];
% calling fminunc
[x, fval, eflag, output] = fminunc(@rosenbrockwithgrad_p, x0, options);
```

It doesn't work.

**Relevant Source Code**

```
function [x, fval, eflag, iter, fcount] =
Optimization_With_Analytic_Gradient(start_point)
x0 = start_point;
% inline function defitions
%fungrad = @(x)deal(fun(x),grad(x));
% options setup
options = optimoptions( 'fminunc', ...
'Display','off',...
'OutputFcn',@bananaout,...
'Algorithm','trust-region', ...
'GradObj','on');
% calling fminunc
[x, fval, eflag, output] = fminunc(@rosenbrockwithgrad, x0, options);
iter = output.iterations;
fcount = output.funcCount;
% plot window title
title 'Rosenbrock with Analytic Gradient...'
disp('Optimization_With_Analytic_Gradient...');
end
function out = gradient( x )
out = [-400*(x(2) - x(1)^2)*x(1) - 2*(1 - x(1));
200*(x(2) - x(1)^2)];
end
function [f,g] = rosenbrockwithgrad(x)
% Calculate objective f
f = rosenbrock(x);
if nargout > 1 % gradient required
g = gradient(x);
end
end
```

]]>
I am trying to solve a system of 2 ordinary differential equations using matlab. However, I am not able to get numerical solutions from the code despite having keyed in all possible solutions.

The equations I am given are:

dx/dt=A(x/t)+By

dy/dt=C(x/t^2)+D(y/t)

and the boundary conditions are:

y(1)=0; y(1.2)=-100E6

- The attempt at a solution

My code so far:

%Mechanical Properties of Material

E=200e9;

nu=0.3;

P=100E6;

%Constants A,B,C,D in the Equations

a11= (1/E);

a12= (-nu/E);

a33= (1/E);

A= (a12)/(a11+a12);

B= ((a33)-((2*a12^2)/(a11+a12)));
C= (a11)/(a11^2-a12^2);
D= (2*a12+a11)/(a11+a12);

%Defining the System of 2ODES

syms x(t) y(t)

eqns = [diff(x,t)==A

cond = [y(1) == 0, y(1.2)==-P];

withSimplifications = dsolve(eqns, cond)

withoutSimplifications = dsolve(eqns, cond, 'IgnoreAnalyticConstraints', false)

[xSol(t), ySol(t)] = dsolve(eqns)

The answer is get is

Warning: Explicit solution could not be found.

In dsolve (line 201)

In IsotropicThickWallCylinder (line 18)

xSol(t) =

[ empty sym ]

ySol(t) =

[ empty sym ]

Would really appreciate some help.

]]>function out = logipack(V)

m = size(V, 1);

S = cell(m, 1);

for r = 1:m

S{r} = find(V(r, );

m = size(V, 1);

if isempty(V(r))

S{r}= [];

end

end

out = S;

end

I am trying to open a file in MATLAB and output the distance parameters. Perhaps there is somewhere I can put the text file and my code and get some help on debugging why the output is wrong?

I am a newbee on this forum!

Regards

Ayushi

Given the following equations ; cos^2(x/2)=(tan(x)+sin(x))/2*tan(x) Please write a Matlab code to verify that the identity is correct when x=π/5.

cos(pi/5)

cos(pi/5)=(tan(pi/5)+sin(pi/5))/(2tan(pi/5))

cos(pi/5)*cos(pi/5)=(tan(pi/5)+sin(pi/5))/(2*tan(pi/5))

↑

Error: The expression to the left of the equals sign is not a valid target for an assignment.

cos(pi/5)*cos(pi/5)

ans =

```
0.6545
```

(tan(pi/5)+sin(pi/5))/(2*tan(pi/5))

ans =

```
0.9045
```

I have written the codes above but they are not matched. I kindly request your help. Thank you...

]]>take higher tone and lower then first toon i have.

I use the sample code like this:

```
F1 = fft(originalSignal);
N = numel(F1);
F1a = F1(1:N/2); % the lower half of the fft
F1b = F1(end:-1:N/2+1); % the upper half of the fft - flipped "the right way around"
t1 = 1:N/2; % indices of the lower half
t2 = 1+ (t1-1) / (1 + 2.^(2/12)); % finer sampling... will make peaks appear higher
F2a = interp1(t1, F1a, t2); % perform sampling of lower half
F2b = interp1(t1, F1b, t2); % resample upper half
F2 = [F2a F2b(end:-1:1)]; % put the two together again
shiftedSignal = ifft(F2); % and do the inverse FFT
```

[

http://stackoverflow.com/questions/20076218/matlab-pitch-shifting-an-audio-signal]

With that sample code--t2 = 1+ (t1-1) / (1 + 2.^(2/12));--` I can take higher toon my wav file produced. But, I couldn't get the lower toon that i want. Please help me to solve that probem. I am a beginer. Thankyou..

]]>Can someone lead me in the right direction to get started? Please and Thank you.

Abdul

Review Question 1:

Assume four row vectors name Prod10, Prod11,Prod12,and

% Prod13 contain data on the production of various electronic devices at

% your company during the four year 2010,2011,2012 and 2013, respectively.

% The corresponding elements in each represent the number of specific part

% manufactured during that year. For example, the first element might

% contain the number of 2N3904 transistor produced during each year, whereas

% the fifth column might contain the same number of elements, corresponding

% to the same produced items.

% Write a single line code to answer each of the following questions.You may

% use the results of any question to answer subsequent questions if desired

% Note that your solutions should work regarless of the number of elements

% in the four vectors.

% (a) Create a new vector TotalProd that contains the total number of each

% item produced during the four year period. Note that TotalProd will have

% the same number of elements as the original four vectors.

% (b) Create a new vector AvgProd that contains the average number

% produced per year of each item during the four year period. Note that

% AvgProd will have the same number of elements as the original four vectors

% (c) Create a four element column vector YearProd that contains the total

% the totalnumber of all units produced during each year.2010 production

% should be in the first top element.

% (d) Determine the maximum number of any type of device produced during

% each year and place the results in a four element column vector MaxProd

% (e) Determine the maximum number of any device produced during any year

% and place the result in the scalar OverallMax.

% (f) If your company makes a profit of one-fifth of one cent each device

% produced, regardless of type, determine the total profit made during this

% four year period and place the result in Profit. Your result should be in

% dollars.

I have a problem hope you can help. please review figure attached. I have 2 hemispheres (radius 10.5 and 2.5cm) that made slits. in the center is cube (red color) 1*1*1cm. I need to calculate area of cube that I see in different view. ex: when I see from view(90,45) I can see a part of cube-> I have to calculate area of this part. but at view (50,60) I can not see the cube => area is 0.

Your help is highly appreciated...

Thank a lots.

]]>Write a function called top_right that takes two inputs: a matrix N and a scalar non-negative integer n, in that order, where each dimension of N is greater than or equal to n. The function returns the n-by-n square array at the top right corner of N.

Write a function called peri_sum that computes the sum of the elements of an input matrix A that are on the “perimeter” of A. In other words, it adds together the elements that are in the first and last rows and columns. Note that the smallest dimension of A is at least 2, but you do not need to check this.

Write a function called light_speed that takes as input a row vector of distances in kilometers and returns two row vectors of the same length. Each element of the first output argument is the time in minutes that light would take to travel the distance specified by the corresponding element of the input vector. To check your math, it takes a little more than 8 minutes for sunlight to reach Earth which is 150 million kilometers away. The second output contains the input distances converted to miles. Assume that the speed of light is 300,000 km/s and that one mile equals 1.609 km.

Write a function that is called like this: amag = accelerate(F1,F2,m). F1 and F2 are three-element column vectors that represent two forces applied to a single object. The argument m equals the mass of the object in units of kilograms. The three elements of each force equal the x, y, and z components of the force in Newtons. The output variable amag is a scalar that is equal to the magnitude of the object’s acceleration. The function calculates the object’s acceleration vector a by using Newton’s law: F = ma, where F is the sum of F1 and F2. Then it returns the magnitude of a.

Write a function called income that takes two row vectors of the same length as input arguments. The first vector, rate contains the number of various products a company manufactures per hour simultaneously. The second vector, price includes the corresponding per item price they sell the given product for. The function must return the overall income the company generates in a week assuming a 6-day work week and two 8-hour long shifts per day.

Thank You!!!

]]>for j=1:99

%Complete Decomposition Contribution

GDC(j,i)=X(:,i)' * (M_d.^0.5) * eps_d(:,j) * eps_d(:,j)' * (M_d.^0.5) * X(:,i);

denom_d(j,i)=eps_d(:,j)' * (M_d.^0.5) * covar * (M_d.^0.5) * eps_d(:,j);

rGDC(j,i)=GDC(j,i)/denom_d(j,i);

end

end

Dimensions are X: 99 * 957 M_d:99 * 99 eps_d:99 * 99 covar: 99 * 99

All the above matrices and vectors are real but the following part of code when run on Matlab gives me a 99 * 957 matrix which has imaginary values. I cannot find the problem with this code. eps_d is a identity matrix of dimension 99 * 99.

thx!!

]]>1-

"Code an iterative method to find a solution to the following equation:

r=x-asinx-b=0

the coefficients a and b can be freely chosen. Plot the convergence steps in a graph with the number of iterations along the horizontal axis against values of r."

Any help at all would be appreciated.

Thanks,

Jason

]]>

Je cherche un programme de prévision ou prédiction à base de réseaux de neurones artificiels sur matlab permettant de prévoir plusieurs sorties à partir de quelques entrées.

S'il vous plait aidez moi.

Et merci bien. ]]>

Essentially what I have is a list of around 80 variables, I want matlab to evaluate every combination of 3 variables and spit out the maximum, it can't just be the highest 3 due to covariances etc.

Any help would be much appreciated

]]>I found a 74% OFF coupon to Learn Matlab Udemy course

Couponcode: MATLAB25

https://www.udemy.com/learn-matlab/?couponCode=MATLAB25 ]]>

I use Matlab for my PhD project.

I want to send the files, and metadata, that I am generating directly to cloud services and from there, I want to share with my professor.

Currently, I am copy and pasting one by one the files and send by email or dropbox. But, it is quite slow and I sometimes I can’t send all the files I would love, and I can only send files, none of the metadata (which I saved as json in a database).

Does someone know about any cloud platform for Matlab which could solve this for me?

Thanks.

]]>