How do I plot a function that has been split into multiple time intervals
I don't know if I understand your problem, but I think it is related to the way to program the following code: t=-1:0.1:6; y...

meer dan 2 jaar ago | 0

hi I am trying to calculate the 4th root of the function f(x)=3x4+7x3−4x2−10x+15 using newtons method and a for - loop
clear clc close all % function f = @(x) 3*x.^4 + 7*x.^3 - 4*x.^2 - 10*x + 1/5; % derivative df = @(x) 12*x.^3 + 21*x.^2...

meer dan 2 jaar ago | 0

Making combinations using random number generators
N=input('give me number of random elements:'); a=input('lower limit of the numbers to generate:'); b=input('upper limit of the...

meer dan 2 jaar ago | 0

| accepted

How to create a noisy signal for wavelet transform practice?
maybe this code will help you N=1000; x=linspace(0,2*pi,N); y=sin(x); y2=randn(1,N); y3=y+y2*.1; subplot(2,1,1);plot(x,y)...

meer dan 2 jaar ago | 1

| accepted

Euler's Method
for n = [10, 20, 40, 80, 160] a = 0; b = .5; c = .25; x = linspace(a,b,n);%[a:n+1:b]; f = x.^3; dx = x(...

meer dan 2 jaar ago | 0

plotting for cosine wave
I change some lines.... N=45; theta=0:360; % range of values of theta Na1=2*N*cosd(theta); % cosd for cos when you use de...

meer dan 2 jaar ago | 0

Solving a simple integral with input equation from user
syms x str = input('Enter an equation in x: ','s') ; f = function_handle.empty; f = eval(['@(x)', str]); %x = f(); xmin= ...

meer dan 2 jaar ago | 1

| accepted

How do I calculate the coefficients C in this function while P and T are given?
You can use this equations: T=[4:4:24]'; P=[1e-4;2.5e-4;6e-4;1e-3;1.6e-3;2.25e-3]; plot(T,P,'o') n=length(P); A=[ones(n,1) ...

meer dan 2 jaar ago | 0

| accepted

How can I find a variation vector of a parameter ?
N=100; a = 355.5+7; b = 355.5-7; r = (b-a).*rand(N,1) + a; figure plot(r) hold on plot([1 N],[a a],'r') plot([1 N],[b b]...

meer dan 2 jaar ago | 0

Error in sum of matrixes
try this Nplies = 8; thetadt = [90; -45; 45; 0; 0; 45; -45; 90]; t = 0.125; %SI unit, milimeters h = Nplies*t; % Ply engine...

meer dan 2 jaar ago | 0

How to rearrange multiple results of a function without using for loop?
Assuming that the initial value of k = 1, then it can be avoided using the repmat command as follows (see vector B), N = 11...

meer dan 2 jaar ago | 0

| accepted

How to calculate distance till the next possible stop?
I don't know is correct, parkinglocations = ["Home" "mobile" "ShoppingMall" "mobile" "Workplace" "mobile" "Home"]'; % when "mo...

meer dan 2 jaar ago | 0

| accepted

How to plot (n) circles with known center and radius
I don't know is you want this: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% theta=10 % azimuthal distance between the centers of circl...

meer dan 2 jaar ago | 0

¿Cómo puedo encontrar los indices de un arreglo con valores repetidos con la función find y operadores relacionales?
Yo pienso que si te interesan las posiciones de los valores es mejor poner lo siguiente: n=find((A<4)&(A~=0))

meer dan 2 jaar ago | 3

display result (numbers)
intent with the format command format long

meer dan 2 jaar ago | 0

if greater than in for loop
seven=(seven>100).*(seven-25)+(seven<=100).*seven;

meer dan 2 jaar ago | 0

Can someone rearrange the code to run
%subdivisions space /time ht=0.01; Tmax=1.2; nx=33; hx=1/(nx-1); x=[0:hx:1]'; %matrices K=stiff2(1/pi^2,hx,nx); M=mass(1/ht,h...

meer dan 2 jaar ago | 0

| accepted

3d line plot help
Using this function: function Y = Piecewise(X1,X2) T = linspace(-7.5,17,120); N = length(T); for n = 1:N if X1(n) > 0 ...

meer dan 2 jaar ago | 0

How to Rotate the Ellipses at calculated angle?
%cov is 2x2 covariance matrix that is generated through a long process t = 0:0.1:2*pi; %time axis %Xest is center of ellipse a...

meer dan 2 jaar ago | 0

Function returning matrix instead of vector
f=@(xf,xdata)xf(1)*(xf(4)+((xf(2)-xdata)/(xf(3)/2))).^2./(1+((xf(2)-xdata)/(xf(3)/2)).^2)

meer dan 2 jaar ago | 0

Missing inputs to distance function
First you need to put you trajectory of the directory, in my case I put this path(path,['/Users/rafaelhernandezwalls/Downloads/...

meer dan 2 jaar ago | 0

Plotting with nested for loops
syms y t=[0 pi 2*pi]; a=[5 10]; for k=1:length(a) for j=1:length(t) f=a(k)*sin(t(j)*y); figure ...

meer dan 2 jaar ago | 0

Plot solutions to a multi variable system: x + 2y + 3z = 4
if using mesh, and plot3 [y,z]=meshgrid(-4:.1:4,-4:.1:4); x=4-3*z-2*y; mesh(y,z,x) plot3(x,y,z,'o');

meer dan 2 jaar ago | 1

| accepted

How do I get a loop to return all the values that I am looking for at one time?
e=0:200:11000; i=1:length(e) Re=6.37e6; g0=9.80665; g=g0*((Re^2)./((e(i)+Re).^2))

meer dan 2 jaar ago | 1

Which method is MATLAB use in poly2 to do a curve fitting?
% -- FT is a string or a FITTYPE specifying the model to fit. % % If FT is a string, then it may be: % % FITTYPE ...

meer dan 2 jaar ago | 0

how can I give each subplot a different title?
figure conRR=linspace(1,100,100); conRR(:,2)=sin(conRR(:,1)); conRR(:,3)=sin(conRR(:,1)); conRR(:,4)=sin(conRR(:,1)); conRR...

meer dan 2 jaar ago | 0

Why is my fundamental frequency at the 15th harmonic order
why don't use the FTTSHIFT, this function Shift zero-frequency component to center of spectrum.

meer dan 2 jaar ago | 0