A résolu


Triangle Numbers
Triangle numbers are the sums of successive integers. So 6 is a triangle number because 6 = 1 + 2 + 3 which can be displa...

plus de 5 ans il y a

A résolu


Add two numbers
Given a and b, return the sum a+b in c.

plus de 5 ans il y a

A résolu


Return area of square
Side of square=input=a Area=output=b

plus de 5 ans il y a

A résolu


Maximum value in a matrix
Find the maximum value in the given matrix. For example, if A = [1 2 3; 4 7 8; 0 9 1]; then the answer is 9.

plus de 5 ans il y a

A résolu


Select every other element of a vector
Write a function which returns every other element of the vector passed in. That is, it returns the all odd-numbered elements, s...

plus de 5 ans il y a

A résolu


Find the sum of all the numbers of the input vector
Find the sum of all the numbers of the input vector x. Examples: Input x = [1 2 3 5] Output y is 11 Input x ...

plus de 5 ans il y a

Réponse apportée
Where am I going wrong in setting up this function?
X(l) = symsum( x(k)* exp(-(1i)*l*k*w), k, 0, N-1 ); use exp function

plus de 5 ans il y a | 0

| A accepté

A résolu


Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

plus de 5 ans il y a

A résolu


Pizza!
Given a circular pizza with radius _z_ and thickness _a_, return the pizza's volume. [ _z_ is first input argument.] Non-scor...

plus de 5 ans il y a

Réponse apportée
Using Help using filter function in Matlab
%true xi = HPFnew.*sin((omega.*t+phase)*pi/180) u = uhat +A*sin((omega*t+phase)*pi/180) Try the above. Also see the fi...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Different results with same code??
D=double(subs(D,k_s)) Use the variable k_s as argument, I get the same results now m_s = 2000; %(kg) ...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Different results with same code??
It depends on values for input variables inside the M and K matrices If you use different values for each of script the resul...

plus de 5 ans il y a | 0

Réponse apportée
Putting a step in x axis
%if true set(gca,'XTicks', 0:50:3600); xlabel('Comprimento de Onda [nm]'); ylabel('Espessura mínima [nm]'); Use...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
graphing data using webread
figure(1) subplot (2,2,z) if z == 1 % plot the data and average plot(x(1:100:end),y(1:100:end),x(1:100:end),avg_y...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
How do I plot a transient voltage response before and after a switch is thrown?
%if true Vc(t>0) = 4.604 * (1 + exp(-t(t>0)./ tau)); plot(t, Vc); title('Capacitor Voltage vs Time'); xlabel('Time (s)'); ...

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
matrix while using ODE45
Shaft_speed=1; % specify a value instead of vector %shaft speed in rad/s Rad_speed=Shaft_speed*((2*pi)/60); %freq of harmo...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Index exceeds the number of array elements
%if true x = 0:h:1;% size has 201 elements Define this according to function calculations e.g. x = 0:1/((N+1)*mm...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Given two arrays a and b how do you implement it to draw a graph with for loop such that the x axis is set of values from a and y axis is the values from b .i.e the graph is the format 'a' vs 'b.......................................................'
clear t = 0:0.1:10; for i = 1:length(t) B(i) = 2*t(i); end [x y] = find(B == max(B)) % finds the row and col indices where...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Plot and scatter plot, weird lines removal
%f true plot(g,f,'+'); Use a marker in the plot function By default plot uses a continous line

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
How can I create a horizontal bar plot and label in each stack
%if width=0.1 barh(a1,width,'stacked') legend('1','2','3','4','5','6','7','8') To add labels on bar sections read the _...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Directivity function (polar pattern) of acoustic dipole in closed form?
%if true theta = 0:360 polar(sin(theta).^2*pi/180)% sin^2(theta)

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
Function keeps getting errors, how to fix?
function RH = RelHum(Tdb, Twb) syms n % define the symbolic n ftoc = @(n) ((n-32)*(5/9)); svp = exp(1)^((16.78*ftoc(Tdb) ...

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
Changing variables within loop equations
L = 1:21; % use a vector for iteration /counter for i = 1:1:L(8) % access them via L ... % your code end for i = L(9):1:...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
how can i make this animation faster in MATLAB?
hmax = 25; % max height n = 100; % make this value smaller h = linspace(0,hmax,n); t = linspace(0,360,n); k = 0; pt = 1/600...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Transfer function, function, Fcn, G
%f true num = [1.077e4] den = [3.439e-7 1 0] Enter the vectors _num and den_ coefficients in the transfer function blo...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Plotting e^-t graph
t = 0:0.1:10; y = exp(-t); plot(t,y) define t and use exp function to calculate and plot the equation

plus de 5 ans il y a | 2

| A accepté

Réponse apportée
How to plot multiple unit tangent vector along a 3D curve using quiver3
t = linspace(0, 2, 80); x1 = t; y1 = t.^2; z1 = t.^3; TangentUni = 1./sqrt(1+4*t.^2+9*t.^4), 2*t./sqrt(1+4*t.^2+9*t.^4), 3*t...

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
How to use fprintf to show collated values for two arrays.
for i = 1:length(X); fprintf('%d,%d\n',X(i),Y(i)); end

plus de 5 ans il y a | 1

| A accepté

Réponse apportée
Generate signal using rectpulse
%if true sign1 = rectpuls(t,A) plot(t,sign1) Use the *rectpuls* function to plot

plus de 5 ans il y a | 0

| A accepté

Réponse apportée
Please help this semilogy error message
N = 100 ip = rand(1,N)>0.5; % generating 0,1 with equal probability s = 2*ip-1; % 0 -> -1; 1 -> 0 >> BPSK modulation nRx_max...

plus de 5 ans il y a | 0

| A accepté

Charger plus