Answered
How do I plot the following polynomial?
With loop for t=1:1200 Cp(t) = 0.99403+1.671*10e-4*t+ ... % all function end t=1:1200; plot(t,cp)

3 years ago | 1

| accepted

Answered
How to perform xor operation on an three input binary bits.
a = xor(1,1); %1 xor 1 = 1 b = xor(a,0) %1 xor 0 = 0 %or c = xor(xor(1,1),0)

3 years ago | 0

| accepted

Answered
Changing values in vector
You can try this code a = abs(randn(1,1000)) cont = 1; while cont < length(a)+1 if(a(cont) < 1 || a(cont) > 10) ...

3 years ago | 0

| accepted

Answered
How to save in separate variables the new values from a loop?
you just have to save number by number for i=1:length(left) x = left{i}; y = right{i}; y= [nan(sum(isnan(y)),1);y...

3 years ago | 0

| accepted

Answered
Find the cell which is containing a string
A={'Dimension','Weight','Qty','Thk','Total Price'}; b = strfind(A,'Price') for n=1:length(b) if (~isnan(b{n})) ...

3 years ago | 0

Answered
How to obtain a plot of some complex function with imaginary and real interval
You can separate in real and imaginary components. A example : var = -1.5+0.75i; realCom = real(var); %only real part imagCo...

3 years ago | 0

Answered
How to find a minimum amount of equal adjacent values in an array?
You can test this code with different A matrix: x = 2; % X x 3000 matrix of example % A = ones(x,1000); %there is always erro...

3 years ago | 0

| accepted

Answered
matlab fuction maximum and minimum
I made a function, I hope help you a = rand(4); %Example of 2D matrix b = reshape(a,1,16); cont = 0; var = zeros(1,length(b))...

3 years ago | 1

| accepted

Answered
How to find longest sequennce within a character array?
cArr = 'aaabee'; vow = ['a', 'e', 'i', 'o', 'u']; for n=1:length(vow) a = strfind(cArr, vow(n)); %search letter by lett...

3 years ago | 0

Answered
How can I introduce a scatter plot for this?
Espero que esto te sirva :D C= 100; D= 0.1; b= 0.15; m= 0.05; g= 9.81; h= 0.001; yn= 0; vo=0; yo=0; yf=0; i = 1; %Pr...

3 years ago | 0

Answered
Similate single sine wave
I commented in other post, but this is a possible answer: time = linspace(-40,40,2000); %change limits signal = 80*sind(2*180*...

3 years ago | 0

Answered
Loop an if with different parameters
You can use for to graph more than once. for n=1:7 e = -n:-1:-n-3 % e values [-1 -2 -3 -4] e = e'; %[-1;-2;-3;-...

3 years ago | 0

| accepted

Answered
Why my plot doesn't show the line?
You can use this example: i = linspace(0,100,1000); c = 3*10^8; f0 = 10^9; d0=10^3; f1 = 1./(10*i/(c+10)); fd = f0-f1; ...

3 years ago | 0

Answered
how to make graph for this function
You can use fplot() for example: syms x; y = @(x) abs(x-4)+abs(x^2-5*x+6)-abs(x+4)+4; fplot(y,'LineWidth',3); xlim([-6 12])...

3 years ago | 0

Answered
how can i change Matrix last row with loop?
this can work for n = 2:6 A22 = eye(n, n-1); A21 = zeros(n, 1); A = [A21, A22]; end A = A(1:5,:)

3 years ago | 0

| accepted

Answered
The minimum value of a matrix array and its index
A = rand(1,5); %example matrix [mini,index] = min(A) %mini= minimum value, index = index of minimum value or A = rand(5) %ex...

3 years ago | 0

| accepted

Answered
Multiple lines of similar variable names
Maybe you can use "cell" to store your arrays, then when using "filloutliers" you run through it with a "for" and store it in an...

3 years ago | 1

Answered
multiplying matrix by another matrix element and using it in a command
You need matrix T to have the same number of rows or columns as matrix Q Q=[-0.0905 0.0604 0.0301;0.142 -0.239 0.097;0 0 0]; %...

3 years ago | 0

Answered
How i do Taylor series summation method?
I hope it helps you! % Integral syms y; fun = @(y) asin(y); resInt = integral(fun,0,1); % Taylor loop with 80 component ...

3 years ago | 0

Answered
Can I make the matrix of size n with only x elements known and rest all 0?
x = [1 2 3 4] large = 8 x = [x zeros(1,large-length(x))]

3 years ago | 0

Answered
How to plot distribution curve of multiple data?
x = [-3:.1:3]; y = normpdf(x,0,1); y2 = normpdf(x,0,0.5); plot(x,y,x,y2) More info:https://es.mathworks.com/help/stats/norma...

3 years ago | 1

| accepted

Answered
How to add NaN values to a matrix?
A = rand(1,48000) %Matrix of example (1x48000) B = rand(1,48449) %Matrix of example (4x48449) C = [A;B(1:48000)] %You can take...

3 years ago | 0

Answered
How to order matrix
You can change the numeric format in Configuration. Change Numeric format in command Window. I hope it helps

3 years ago | 1

Answered
Multiplying each value of a vector with the corresponding value in another vector?
with loop for for n = 1:length(E) theta(:,n) = E(n)*A(n)*alpha(n)*temp(n) * [-1;1] end or can be: theta(n) = E.*A.*alpha.*...

3 years ago | 0

Answered
Hello, I am trying to plot the fourier series of a function but it doesnt seem to be giving me anything near the graph of the original fuction.
What is the waveform it is supposed to give? Did you try a simpler function? I tried with this code: (Sawtooth wave) t= 0:1e-3...

3 years ago | 0

Answered
How to produce a plot for signals?
t = 0:1e-3:5 %time of sampling x = 2*sin(5*t); %evaluated function plot(t,x); %plot(axis x,axis y) More info: https://es.ma...

3 years ago | 0

| accepted

Answered
Time Scaling In Discrete Time Signals
n=[-2 -1 0 1 2 3 4]; x=[3 1 0 4 6 2 9]; stem(n,x);hold on; %original n2 = 4*n; stem(n2,x); %x4 n3 = 2*n; stem(n3,x);%x2 t...

3 years ago | 0

Answered
create a loop to determine the pixel distance from the center using the distance formula
you just have to move (x, y). (x_c, y_x) are fixed. image = imread('sunflower,jpg'); [l,h,~] = size(image); %(x_c,y_c) = c...

3 years ago | 0

| accepted

Answered
How to create an array and combine and put two images into it
Maybe you need to resize or add white pixels so that the images have the same dimension. A = imread('Yuan.jpg'); ACrop = A(300...

3 years ago | 0

| accepted

Answered
creating a function that plots sinewaves for different parameters.
%signal = autoWave(frecuency(Hz),amplitude) signal = autoWave(5,2); Function: function [signal]=autoWave(frecuency,amplitude)...

3 years ago | 0

Load more