# Unrecognized function or variable

69 views (last 30 days)

Show older comments

syms t

x(t) = piecewise (t>=0, sin(3*t), t>=2*pi, sin(3*t)^2, t>3*pi,0);

t1 =0:0.1:3*pi;

x=subs(x,t,t1);

plot(t1,x)

xlabel('Time')

ylabel('x(t)')

disp('Energy of x(t)')

Energy of x(t)

I1 = int(sin(3*t)^2);

I2 = int(sin(3*t)^4);

E = I1(2*pi)-I1(0)+I2(2*pi)-I2(3*pi)

Energy of x(t)

Unrecognized function or variable 'Energy'.

This is my code I'm not sure why it is saying unrecognized function any help would be appreciated thank you.

##### 0 Comments

### Answers (3)

Steven Lord
on 8 Feb 2021

madhan ravi
on 8 Feb 2021

Following Steven’s answer would clear that error but you will have a following error, so change that part of your code to the following:

%Energy of x(t)

I1(t) = int(sin(3*t)^2);

I2(t) = int(sin(3*t)^4);

E = I1(2*pi)-I1(0)+I2(2*pi)-I2(3*pi)

%Energy of x(t)

muhammad satriawan
on 8 Jul 2021

p = [ 0.1987 0.2722 0.0153 0.4451 0.466 0.8462 0.2026 0.8381 0.6813 0.8318 0.7095 0.3046 0.1934 0.3028 ;

0.6038 0.1988 0.7468 0.9318 0.4186 0.5252 0.6721 0.0196 0.3795 0.5028 0.4289 0.1897 0.6822 0.5417 ];

net = newc ([0 1 ; 0 1],6);

net.IW {1,1};

net.b {1};

net = train (net,p);

%Mencari pengelompokan vektor

b = sim(net,p);

ac = vec2ind(b);

net = init(net);

net.trainParam.epochs = 500 ; %pelatihan kohonen

net = train(net,p);

Unrecognized function or variable 'newc'.

Error in JKohonen (line 5)

net = newc ([0 1 ; 0 1],6);

##### 0 Comments

### See Also

### Categories

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!