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.

]]>This is as fast as I have been able to do it. ****matlabFunction and subs go slower than this.

The code below is my solution and it is one loop. In my larger code the function f and point x0 change in every loop so you can imagine why I want this to go as fast as possible. I would greatly appreciate it if someone could go through this, and give me any pointers. If my coding is crap feel free to tell me

x = sym('x',[2,1]);

f = [x(1)-x(1)*cos(x(2)), x(2)-3*x(2)^2*cos(x(1))];

J = jacobian(f,x);

x0 = [2,1];

N=length(x0); % Number of equations

%% Transform into string

fstr = map2mat(char(f));

Jstr = map2mat(char(J));

% replace every occurence of 'xi' with 'x(i)'

Jstr = addPar(Jstr,N);

fstr = addPar(fstr,N);

x = x0;

phi0 = eval(fstr)

J = eval(Jstr)

function str = addPar(str,N)

% pstr = addPar(str,N)

% Transforms every occurence of xi in str into x(i)

% N is the maximum value of i

% replace every occurence of xi with x(i)

% note that we do this backwards to avoid x10 being

% replaced with x(1)0

for i=N1

is = num2str(i);

xis = ['x' is];

xpis = ['x(' is ')'];

str = strrep(str,xis,xpis);

end

function r = map2mat(r)

% MAP2MAT Maple to MATLAB string conversion.

% Lifted from the symbolic toolbox source code

% MAP2MAT(r) converts the Maple string r containing

% matrix, vector, or array to a valid MATLAB string.

%

% Examples: map2mat(matrix([[a,b], [c,d]]) returns

% [a,b;c,d]

% map2mat(array([[a,b], [c,d]]) returns

% [a,b;c,d]

% map2mat(vector([[a,b,c,d]]) returns

% [a,b,c,d]

% Deblank.

r(findstr(r,' ')) = [];

% Special case of the empty matrix or vector

if strcmp(r,'vector([])') | strcmp(r,'matrix([])') | ...

strcmp(r,'array([])')

r = [];

else

% Remove matrix, vector, or array from the string.

r = strrep(r,'matrix([[','['); r = strrep(r,'array([[','[');

r = strrep(r,'vector([','['); r = strrep(r,'],[',';');

r = strrep(r,']])',']'); r = strrep(r,'])',']');

end

]]>

I need to perform the following using MATLAB.

1) Identify duplicate years in 2nd column and keep the one with maximum value with the 3rd column.

For example, (see the image below) since I have two 1961 occurences in column 2, need to remove one 1961 which has a highest corresponsding value in 3rd column (keep row with 5430 and remove 1160)

How can I perform this in MATLAB. Any help is appreciated.

Thanks.

]]>I have data for nine participants and four different variables (Right Knee, Left Knee, Right Ankle and Left Ankle) which I have imported into matlab.

I want to find the maximum value for each variable and each participant. I have written the following script:

for joint_num = 1:4

```
if joint_num == 1
joint = 'LAnkle';
elseif joint_num == 2
joint = 'RAnkle';
elseif joint_num == 3
joint = 'LKnee';
elseif joint_num == 4
joint = 'RKnee';
File = ['TorqueData_',joint,'_Isom'];
MaxT = max (TorqueData_LAnkle_Isom);
MaxT = max (TorqueData_RAnkle_Isom);
MaxT = max (TorqueData_LKnee_Isom);
MaxT = max (TorqueData_RKnee_Isom);
end
```

end

However, when I run the script, instead of getting a table of four rows and nine columns with the maximum values of each variable, I get one row of nine columns, with the maximum values of the last variable (RKnee).

I'm sure this is something simple but I am new to matlab and really struggling! If anyone could helpt it would be very much appreciated.

Thanks and Best Wishes

]]>I am a mathematician. I have to write a matlab or octave function: function(m)=multsines(f1,f2)

which calculates the mean, m, of the product of the two sine with frequencies f_1,f_2, and plots the product in a figure.

Any help?

Thanks!

]]>code is given below.

[FileName,PathName] = uigetfile('

I = double(imread([PathName '\' FileName]));

% normalize between 0 and 255

bw=~im2bw(I,0.5); %Threshold and invert

subplot(1,2,1), imshow(bw,[]);

[y,x]=find(bw>0.5); %Get coordinates of non zero pixels

centroid=mean([x y]); %Get (centroid) of data

hold on; plot(centroid(1),centroid(2),'rd'); %Plot shape centroid

C=cov([x y]); %Calculate covariance of coordinates

[U,S]=eig(C)

m=U(2,1)./U(1,1);

const=centroid(2)/m.

xl=50:450; yl=m.

subplot(1,2,2), h1=line(xl,yl); %Display image and axes

set(h,'Color',[1 0 0],'LineWidth',2.0)

m2=U(2,2)./U(1,2);

const=centroid(2)/m2.

x2=50:450; y2=m2.*x2+const

h2=line(x2,y2);

set(h,'Color',[1 0 0], 'LineWidth',2.0), ]]>

clc

msg_orig(1)=0;

msg_orig(2)=1;

msg_orig(3)=0;

msg_orig(4)=0;

msg_orig(5)=1;

msg_orig(6)=0;

msg_orig(7)=1;

msg_orig(8)=1;

msg_orig(9)=0;

msg_orig(10)=0;

msg_orig(11)=0;

msg_orig(12)=1;

msg_orig(13)=0;

msg_orig(14)=0;

msg_orig(15)=1;

msg_orig(16)=0;

msg_orig(17)=1;

msg_orig(18)=1;

msg_orig(19)=0;

msg_orig(20)=0;

msg_orig(21)=0;

msg_orig(22)=1;

msg_orig(23)=0;

msg_orig(24)=0;

msg_NRZ=zeros(1,1152);

sig_I=zeros(1,1152);

t=[1:1:1152];

k=1;

t_1 = [ 0 : 1 :1152 ]; % Time Samples

f = 8000; % Input Signal Frequency

fs = 96000; % Sampling Frequency

c_carrier = round(10000*sin(2*pi*f/fs*t_1)); % Generate Sine Wave

for j=1:24

if msg_orig(j)==1

for m=1:48

msg_NRZ(k)=1;

k=k+1;

end

end

if msg_orig(j)==0

for l=1:48

msg_NRZ(k)=-1;

k=k+1;

end

end

end

```
for i=1:1152
sig_I(i) = msg_NRZ(i) * c_carrier(i);
end
```

% figure(1);

% stem(t,sig_I,'r'); % View the samples

% figure(2);

% stem(t*1/fs*1000,sig_I,'r'); % View the samples

% hold on;

plot(t*1/fs*1000,sig_I); % Plot Sine Wave

Fs=96000;

T = 1/Fs; % Sample time

L = 8000; % Length of signal

NFFT = 2^nextpow2(L); % Next power of 2 from length of y

Y = fft(sig_I,NFFT)/L;

f = 96/2*linspace(0,1,NFFT/2+1);

% Plot single-sided amplitude spectrum.

plot(f*1000,2*abs(Y(1:NFFT/2+1)))

title('Single-Sided Amplitude Spectrum of BPSK signal')

xlabel('Frequency (Hz)')

ylabel('|Y(f)|')

Thanks in Advance.

]]>

This link is a photo of the homework assignment.

http://www.chegg.com/homework-help/questions-and-answers/someone-help-figure-matlab-program-run--im-issues-q7074389

What kind of inputs does the QAM functions would accept? ]]>

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

]]>In fact, I'm working on a project which aims to implement a reconfigurable Zigbee tranceiver on XUPV5-LX110T Evaluation platform which integrates a Virtex 5 FPGA. I am currently in the phase of real test, so now I just want to test my transmitter.

First, I want to send my binary data from Matlab (computer) to FPGA. The medium of communication is the RS232 serial link. Is there a solution in Matlab (communication protocol) that sends a binary stream on this port knowing my main entrance on FPGA is 4 bits?

Secondly, how to create a PRBS (Pseudo Random Binary Sequence) in Matlab (an output of 4 bits) to integrate it into the communication protocol?

And thank you in advance for everyone.

Regards,

Isamel ]]>

I know that one way to do this is to create mex file for that VC++ executable project.

Is it possible to run simulation in Matlab GUI which i have already in VC++ using mex files. Does anyone has experience doing this stuff .

Is there any other way to achieve it. Thanking you. ]]>

this is wrong with the code To start with, the following lines are incorrect:

```
CONST=READ_CONi(i);
CONSTH=CONST(1);
CONSTL=CONST(2);
```

This way, you read 2 hexadecimal digits (8 bits) from the table, then

assign the first digit (left 4 bits) to CONSTH, and the second digit

(right 4 bits) to CONSTL. However, in section 2.3 of the algorithm, it

says the round constant is 6 bits and CONSTH is the left 3 bits and

CONSTL is the right 3 bits:

CONi(6) = CONiH(3) || CONiL(3)

and then when processing both CONSTH and CONSTL are padded with a '0' on

the left side.

You work on hex digits rather than bits, which is conceptually correct,

but wrong in terms of coding

I have been given a data.mat file which contains a dataset containing the varriables ( when i click on it in the workspace): data.X(258x226 double), data.Y (258x226 double), data.XUnits ('m'), data.YUnits ('m'), data.Val (43x257x225 double), data.Time (43x1 double), data.Name (`temp'), data.Units ('C')

Therefore, it has X coordinates, Y coordinates, time and a value at each one of these.

My question is can anyone give me a little script that will create a graph with TEMP (val) vs TIME for a given x and y coordinate?

]]>"Vq = interp3(X,Y,Z,V,Xq,Yq,Zq) returns... X, Y, and Z contain the coordinates of the sample points. V contains the corresponding function values (SCALAR) at each sample point. Xq, Yq, and Zq contain the coordinates of the query points." This is just what I have mentioned at the beginning. interp3 operate with function (bijection, correspondence) from space with 3 coordinates (3D, triplet) to space with 1 coordinate (1D, scalar). I want to establish and operate with correspondence from 3D to 3D..

TPS solves such problems. http://www.mathworks.com/matlabcentral/fileexchange/37576-3d-thin-plate-spline-warping-function

http://www.mathworks.com/matlabcentral/fileexchange/22227-thin-plate-splines

I used the first link. The interface is pretty straightforward. I marked: 1. points: old positions of control points; 2. ctrlpoints: new positions of control points; 3. object: source template.

But I want Kriging now.

Thank you very much.

]]>In fact, I'm working on a project which aims to implement a reconfigurable Zigbee tranceiver on XUPV5-LX110T Evaluation platform which integrates a Virtex 5 FPGA. I am currently in the phase of real test.

First, I want to send my data from a PC to FPGA and receive it (to treat my signals on Matlab). Is this possible or not? If yes, Is there a solution for it using a medium of communication (e.g. serial link)

Second, is there a measuring equipment and testing (e.g. Agilent or National Instruments using PXI) which supports the Zigbee wireless protocol or otherwise IEEE 802.15.4 standard (i.e. RF Vector Signal Generator and Vector Signal Analyzer) of the analog front-end either in transmission or reception?

And thanks a lot in advance for everyone. ]]>

I f anyone can give me only a code for four wheel vehicle dynamics it would also work.

Please help ]]>

My aim is to illustrate lissajous figure of CRO.

The concept is to plot a locus of point whose x & y coordinate vary with time.

In the code given below I have put x=sin(constant x t) , y=cos(1.5 x constant x t)

[code]

Fs = 8000; % samples per second

dt = 1/Fs; % seconds per sample

StopTime = 6.00; % seconds

t = (0:dt:StopTime-dt)'; % seconds

%% Sine wave:

Fc = 80; % hertz

c = -pi:.04:pi;

cx = sin(pi*Fc*t);

cy = cos(1.5*pi*Fc*t);

figure('color','white');

axis on, axis equal

line(cx, cy, 'color', [.4 .4 .8],'LineWidth',3);

title('sine on x , cos on y ','Color',[.6 0 0])

hold on

ht=plot(cx,cy,'r.','MarkerSize',20)

while (1)

for t = 1:length(t)

x(2) = cx(t);

y(2) = cy(t);

set(ht,'XData',x)

set(ht,'YData',y)

drawnow

end

t = (0:dt:StopTime-dt)';

end

[/code]

I have 3 questions

(1)If you will run this , you will see (other than a nice double boomerang animation) a red dot at origin in graph which I want to avoid.

(2)I want to create a slider button for user which replaces 1.5 in above . This way , when slider=1 you will see circle , as frequency multiplies you will see more vertically side by side loops . As frequency diminishes to fraction loop will appear horizontally stacked.

(3)it would be more exciting if there is a slider for changing phase difference .Currently it is 90 degree . As it will decreases the ellipse flattens. becomes straight line for 0 degree.

Thank You.

Eagerly waiting for your reply.

im not sure this is the right forum but since the headline says also "chilling after a day of programming" I thought I could post a tip for a mathmatical tool which seems to be something for the old idealists like myself, prefering programming tools to be free of charge and with an anarchistic touch. At www.varible.com you find a program similar to Matlab, it still seems to be under construction and it is not as advanced as the original, on the other side it gives you the opportunity to calculate standard functions in an easy way and if you want to, share your programs with friends and colleagues.

It is at least better than other "online calculators" I have found.

Have fun!

]]>"error creating file/Users.../filename.m in current folder: No such file or directory"

and then it asks me if I want to create an untitled document.

Help please!

If someone have any small virtual reality application/environment (which is built with initial tools of Virtual Reality Toolbox), please send me(with description) on my email address so that I understand this toolbox . [color=Blue]mwasif_ciit@yahoo.com[/color]

And if anyone have any helping materiel on Virtual Reality Toolbox of MATLAB, please send me.

I will be very thankful to you...

]]>

```
for(j=0;j<n;j++)
{
for(i=0,k=j;i<=j && k<=j; i++)
{
print [k][i] //this part prints the value present in [k][i] co-ordinates of a 2-D array
k--;
}
}
```

I am not getting how to write this in MATLAB. Help

]]>http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.39.5132&rep=rep1&type=pdf ]]>

I'm trying to figure out how the integrator block from Simulink works. I'm doing this because I need to make an arduino program in order to implement a space-state control.

Any help is welcome. Thanks in advance

]]>