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

]]>[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

]]>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

]]>I have written code to generate a graph in Matlab. However the Journal I am submitting my manuscript to, has given the following guidelines to convert matlab images to tif:

&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&7

Export High Resolution Images from Matlab

Knowing the target size of your image in inches and ppi, first convert the number of rows and columns in the image. 4.86 inches by 9.19 inches (a 1.5-column figure at maximum height) at 300ppi corresponds to 1458 pixels by 2757 pixels. Modify your image to be 1458 by 2757. (Resize it, crop it, compute it differently, etc.) Then save your 1458 by 2757 image to a TIFF file, specifying 300 as the resolution:

imwrite(my_image, 'figure_10_a.tif', 'Resolution', 300);

function writeFig300ppi(figNo, fileName)

%make the backgroung white

set(figNo,]]>

f=imread('source_image.jpg');

figure(1)

imshow(f)

imwrite(f,'new_tif_image_file.tif','compression','none','resolution',...

[100 80])

g=imread('new_tif_image_file.tif');

figure(2)

imshow(g)

~~after all these done I look at two images and they look same...

what problem in this code?

]]>

%Consider the mass-damper system with dead zone as depicted in Figure E.1. %The motion of the system is described by the following combination of %equations: %my" + 2cy' + k(y + b) = F(t), y<-b %my" + 2cy' = F(t), -b<=y<=b %my" + 2cy' + k(y - b) = F(t), y>b

%%

%(a) Rewrite the above as a single equation using the heaviside function.

```
A = [ 0 0 0 5
0 2 0 0
1 3 0 0
0 0 4 0];
a=size(A);
b=size(A);
c=0;
position=0;
for i=1:a for j=1:b if A(i,j) ~=0
c=c+1;
position=position+1;
S(c,:)=[position,i,j,A(i,j)];
end
end
end
S
```

S --> is the storage matrix for all the non zero elements for A matrix. In addition to this information(Index,Row Number, Column Number, Value) how do I include two more columns in the matrix which shows the next element in row & the next element in column.

]]>I have a large data set, consisting of 17 elements with more than 30000 samples which i use as an Input and a Target data set. I use the GUI in NN Toolbox to load the data and perform the training. The results after training seem to be good, as i get a relatively small error. However when i load the second data set which i want to use for the simulation my error gets really high. I read about generalization problems and over fitting issues but I'm not sure how to deal with these and how to change my code so that i improve my simulation performance.

Furthermore I'm not sure about the setup of my network - number of hidden neurons, the percentages of Tr./Val./Test. etc?

I would be really thankful if anyone could help me out here. Thanks & best regards

]]>

I want to implement mexican hat wavelet on a 2-D image like lena and extract feature points from it.

Please guide me.

Thank You

]]>

I want simulate classically (not quantum mechanics) a electron orbiting a proton (H atom) immerse in a random distribution electromagnetic field. This theory is known as SED http://www.bu.edu/simulation/publications/dcole/PD...

For now we will forget the random EM. Since I'm trying first simulate the electron orbit without influence of EM.

As you now classically the electron feel the Coulomb force and the reaction term. The reaction term make the electron spin down and shock with the nucleus, the proton.

The non-relativistic Lorentz/Dirac equation to the movement is:

m*z'' = (-e^2)*z/|z|^3 + REAC - e*(EM)

The EM are the E and B random equations but for now we will forget this term.

REAC is the reaction term =>

2/3 * e^2 /c^3 * z''' (so third order differential eq)

but REAC can be approximated to

2/3 * e^2 /c^3 * d/dt( (-e^2)/m * z / z^3 ) ---> first order equation

the problem is in 2D x-y, so the vector z have two components, the z is the radius = sqrt(x^2 + y^2)

I can plot the electron orbit only with the Coulomb term:

((-e^2)*z/|z|^3)

but I cannot plot correctly with the REAC term. I already try use the ode45, the ode23 and the ode23t

I also tried use the REAC in the first form (third order ode) and in the second form

I also tried use polar coordinates, I'm lost I need help the following code is the my successful implementation of ode without the REAC

function mov = semZPF2(t,y)

r=(sqrt(y(1)^2+y(2)^2));

e = 1.602177e-19;

m=9.10938291*10^-31;

mov(1)=y(3);

mov(2)=y(4);

mov(3)=(-e^2*y(1)/r^3)/m;

mov(4)=(-e^2*y(2)/r^3)/m;

return;

------------------------------------------------------

yi=[0 5.3*10^-11]; % initial position

vi=[23.0583421525753 0]; % initial velocity

[t,y]= ode45(@(t,y) semZPF2(t,y,), [0 1E-12] , [yi vi] );

plot (y(i,1), y(i,2))

Please I need your help to implement the REAC term

m*z'' = (-e^2)*z/|z|^3 + REAC

thanks,

Carlos Henriques

]]>