Answered

Need help with a riemann sum

Cambié un poco el código, pero casi nada. clearvars; a = 0; b = 2; n_rec = 100; delta_x = (b-a)/n_rec; x = 0:delta_x:2; %...

Need help with a riemann sum

Cambié un poco el código, pero casi nada. clearvars; a = 0; b = 2; n_rec = 100; delta_x = (b-a)/n_rec; x = 0:delta_x:2; %...

2 days ago | 0

Answered

Improfile changing colour of plot

You can try: %Example Mathwork I = imread('liftingbody.png'); x = [19 427 416 77]; y = [96 462 37 33]; [a,b,c] = improfile(...

Improfile changing colour of plot

You can try: %Example Mathwork I = imread('liftingbody.png'); x = [19 427 416 77]; y = [96 462 37 33]; [a,b,c] = improfile(...

3 days ago | 0

| accepted

Answered

I'm trying to take the integral with two variables being arrays and this error keeps popping up. I'm not sure if there is another way, or if im missing something. this is what i have put in the code.

I think the upper limit of integral cannot be a matrix. if you change Iy = int(dA*x^2,x,0,b) %b is array the code works sym...

I'm trying to take the integral with two variables being arrays and this error keeps popping up. I'm not sure if there is another way, or if im missing something. this is what i have put in the code.

I think the upper limit of integral cannot be a matrix. if you change Iy = int(dA*x^2,x,0,b) %b is array the code works sym...

3 days ago | 0

Answered

Random selection from a pool of questions

I changed 2 lines and it works QandA={'what is 6x8? ', '48'; 'what is 12x12? ', '144'; 'what is 60/12? ', '5'; ...

Random selection from a pool of questions

I changed 2 lines and it works QandA={'what is 6x8? ', '48'; 'what is 12x12? ', '144'; 'what is 60/12? ', '5'; ...

3 days ago | 1

| accepted

Answered

y=a*b^x

For example if your y = a*cos(x), you can use plot like this: x = 0:1e-2:20; %x values a = 2; %can be anything constant number...

y=a*b^x

For example if your y = a*cos(x), you can use plot like this: x = 0:1e-2:20; %x values a = 2; %can be anything constant number...

3 days ago | 0

Answered

Why is my functions not plotting a line?

you need add one point Wab=9.42; d=0.12; s=0.1; % 0.3, 0.6 & 0.9 theta=0:0.1:6.28 Wcd=(s.*Wab.*(s+sin(theta)))./(1+s.^2+2...

Why is my functions not plotting a line?

you need add one point Wab=9.42; d=0.12; s=0.1; % 0.3, 0.6 & 0.9 theta=0:0.1:6.28 Wcd=(s.*Wab.*(s+sin(theta)))./(1+s.^2+2...

3 days ago | 2

Answered

How can I stop my program and ask for the wish operation?

You can use a if umi = '1 = A*B 2 = A/B '; opc = input(umi); %input (multiply or divide?) disp(' ') dis...

How can I stop my program and ask for the wish operation?

You can use a if umi = '1 = A*B 2 = A/B '; opc = input(umi); %input (multiply or divide?) disp(' ') dis...

3 days ago | 0

Answered

how can I plot multiple y values for single x value?

you can try creating a vector of ones and multiplying this by your x values, for example: y = rand(1,15); xvalue = 3; x = xva...

how can I plot multiple y values for single x value?

you can try creating a vector of ones and multiplying this by your x values, for example: y = rand(1,15); xvalue = 3; x = xva...

3 days ago | 0

Answered

Matlab program to plot y(t) graph

If you function is y(t), and you iterate this function in the time, your can plot it: time = 0:0.01:1; y = sin(time) %Your y(t...

Matlab program to plot y(t) graph

If you function is y(t), and you iterate this function in the time, your can plot it: time = 0:0.01:1; y = sin(time) %Your y(t...

6 days ago | 0

Answered

High Frequency Square Wave

You can try with square() --> More Info For example: time = linspace(0,1,1000); frecuency = 5; %or other frecuency x = squar...

High Frequency Square Wave

You can try with square() --> More Info For example: time = linspace(0,1,1000); frecuency = 5; %or other frecuency x = squar...

6 days ago | 0

| accepted

Answered

Storing data in matlab matrix using loop

You can try use cell() i=1; for k1=2:1:20 for k2=2:1:20 for k3 = 2:1:20 M = [k1,k2,k3]; if...

Storing data in matlab matrix using loop

You can try use cell() i=1; for k1=2:1:20 for k2=2:1:20 for k3 = 2:1:20 M = [k1,k2,k3]; if...

6 days ago | 0

| accepted

Answered

Solve equation in interval

You can try: syms x f = x^2*exp(-x) fder = diff(f,x,1) vpasolve(fder,[-1 1]) %change solve

Solve equation in interval

You can try: syms x f = x^2*exp(-x) fder = diff(f,x,1) vpasolve(fder,[-1 1]) %change solve

6 days ago | 0

| accepted

Answered

Calculation of two less than equal

For the left side it is: n = sqrt(C-1); The other side it is the same.

Calculation of two less than equal

For the left side it is: n = sqrt(C-1); The other side it is the same.

7 days ago | 0

Answered

Problem in using symsum

syms x k x(1)=-2; x(2)=-1; x(3)=0; x(4)=1; x(5)=2; f(1)=-2; f(2)=-1; f(3)=0; f(4)=1; f(5)=2; for i=0:4 a{i+1}=...

Problem in using symsum

syms x k x(1)=-2; x(2)=-1; x(3)=0; x(4)=1; x(5)=2; f(1)=-2; f(2)=-1; f(3)=0; f(4)=1; f(5)=2; for i=0:4 a{i+1}=...

7 days ago | 0

Answered

Plot please help / plot the domain of transfer function

You can try with tf(): more info: https://es.mathworks.com/help/control/ref/tf.html fun = tf([5 30 55 30],[1 9 33 65]); % B(s...

Plot please help / plot the domain of transfer function

You can try with tf(): more info: https://es.mathworks.com/help/control/ref/tf.html fun = tf([5 30 55 30],[1 9 33 65]); % B(s...

8 days ago | 0

Answered

How can I write the matlab

I made a function that maybe help you: Link: https://es.mathworks.com/matlabcentral/fileexchange/82783-waveform-fourier-series-...

How can I write the matlab

I made a function that maybe help you: Link: https://es.mathworks.com/matlabcentral/fileexchange/82783-waveform-fourier-series-...

10 days ago | 0

| accepted

Answered

Piecewise function plot help

The length must be the same x1 = [0:0.1:1]; f1 = zeros(1,numel(x1)); %f1 with the same length as x1 x2 = [1:0.1:3]; f2 = [1/...

Piecewise function plot help

The length must be the same x1 = [0:0.1:1]; f1 = zeros(1,numel(x1)); %f1 with the same length as x1 x2 = [1:0.1:3]; f2 = [1/...

10 days ago | 0

| accepted

Answered

How to create a periodic function?

You can use this function: https://es.mathworks.com/matlabcentral/fileexchange/83058-continuous-piecewise-function-linear-funcio...

How to create a periodic function?

You can use this function: https://es.mathworks.com/matlabcentral/fileexchange/83058-continuous-piecewise-function-linear-funcio...

11 days ago | 0

Answered

Error Message: valid interpreter syntax

add in xlabel() xlabel(filename,'Interpreter','none')

Error Message: valid interpreter syntax

add in xlabel() xlabel(filename,'Interpreter','none')

11 days ago | 0

| accepted

Answered

Show filtered column of a cell array based on filtered cell header

Hi :D data= {'A' ,'B' ,'C';'1', '2', '3';'1' ,'2', '3';'1', '2', '3'}; fprintf("input with a space \n") %Example: a b or a c...

Show filtered column of a cell array based on filtered cell header

Hi :D data= {'A' ,'B' ,'C';'1', '2', '3';'1' ,'2', '3';'1', '2', '3'}; fprintf("input with a space \n") %Example: a b or a c...

11 days ago | 0

| accepted

Answered

solving for an unknown variable when given the rest

syms V y = 0.05; k = 0.0806; v = 90; N = 4; h = solve(y == 1/((1+k*(V/v))^N),V) %multiplication sign missing you only shou...

solving for an unknown variable when given the rest

syms V y = 0.05; k = 0.0806; v = 90; N = 4; h = solve(y == 1/((1+k*(V/v))^N),V) %multiplication sign missing you only shou...

11 days ago | 1

| accepted

Answered

How to use loop to reduce the code?

you can try with cell clc clear syms t sigma r = -4; w = 2; a = 1; b = 1; W = 1; x_2 = 1 A_sin = 1; A_sigma = [0,1;-w...

How to use loop to reduce the code?

you can try with cell clc clear syms t sigma r = -4; w = 2; a = 1; b = 1; W = 1; x_2 = 1 A_sin = 1; A_sigma = [0,1;-w...

11 days ago | 0

| accepted

Answered

How to eliminate standalone 1 or 0 in binary matrix

You only need a loop and correct conditional statement, the conditional can be: if(A(n) ~= A(n+1) && A(n) ~= A(n-1) && A(n) == ...

How to eliminate standalone 1 or 0 in binary matrix

You only need a loop and correct conditional statement, the conditional can be: if(A(n) ~= A(n+1) && A(n) ~= A(n-1) && A(n) == ...

13 days ago | 0

Answered

How to create hatched fill pattern histograms?

hello. You can try with the function in this url: https://es.mathworks.com/matlabcentral/fileexchange/1736-hatched-fill-patter...

How to create hatched fill pattern histograms?

hello. You can try with the function in this url: https://es.mathworks.com/matlabcentral/fileexchange/1736-hatched-fill-patter...

13 days ago | 0

| accepted

Answered

numerator , denominator, Transfer function,Equation

You just need to enlarge the block

numerator , denominator, Transfer function,Equation

You just need to enlarge the block

13 days ago | 0

| accepted

Answered

Calling a user-created function in a different script

You can call a function in your folder for example if your function is: function x = mulx2(y) x = 2*y; end from the main fi...

Calling a user-created function in a different script

You can call a function in your folder for example if your function is: function x = mulx2(y) x = 2*y; end from the main fi...

14 days ago | 1

| accepted

Answered

why is my vector bigger than how I created

Because the values are saved from space 11 onwards. You must change n+1 in sumvec() n+1 = 11 -- n-9 = 1 sum = 0 sumvec = [] ...

why is my vector bigger than how I created

Because the values are saved from space 11 onwards. You must change n+1 in sumvec() n+1 = 11 -- n-9 = 1 sum = 0 sumvec = [] ...

14 days ago | 0

| accepted

Answered

Creating a Matrix of random numbers

A long way bits= randi([-1 1],20,20); [r,c,~] = size(bits); count = 1; while count < (r*c)+1 bits = reshape(bits...

Creating a Matrix of random numbers

A long way bits= randi([-1 1],20,20); [r,c,~] = size(bits); count = 1; while count < (r*c)+1 bits = reshape(bits...

14 days ago | 0

Answered

Why am I not able to plot the error vs iterations?

You can store the data of (Z-z) in a vector: for ... zz(i) = (Z-z) if abs(zz)<10^(-6) break end end... ...

Why am I not able to plot the error vs iterations?

You can store the data of (Z-z) in a vector: for ... zz(i) = (Z-z) if abs(zz)<10^(-6) break end end... ...

14 days ago | 0

Answered

Bit wise operation of And and XOR together

The binary operation is between two values logics or values of 0's and 1's. In your code some logics operation are done between ...

Bit wise operation of And and XOR together

The binary operation is between two values logics or values of 0's and 1's. In your code some logics operation are done between ...

14 days ago | 0