matlab

Calculating the amount in a loop with an exit condition

You need to write a function to solve this example: I have a problem with the function: function array = sumx(x) array ... x units, I don't think it should be so. I must have misunderstood the math part of the assignment. What could be the problem?

Symbolic calculations in MATLAB

How to create an analytical record for a given function using symbolic variables and MATLAB commands: f(x) = {x, 0<=x<=1/2; 1-x,1/2<=x<=1} ?

Graph of a symbolic function in MATLAB

How is a character function graph constructed in MATLAB?

How to connect arduino to Matlab

Put matlab 2016 Added packages for working with matlab and simulink with arduino. Which cketch should I pour into the arduino to control it from the matlab?

matlab: simplifying expressions

Please tell me why Matlab stubbornly does not want to simplify the expression: syms x f = str2sym('1/(sqrt(2*pi)*sigma*x)*e ... though it should have combined two exponents into one and collapsed the logarithm of the exponent What could be the problem?

Calculating the divergent rotational of a function in Matlab

I have a college job where I should create a routine to calculate the divergent rotational of any function in matlab. Search ... mbering that the divergent is calculated by the partial derivative of i relative to x, j relative to y, and k relative to z.

How to use the "print" command to show variables in string along with integers in MATLAB?

I'm doing an exercise in MATLAB, but I always come across an error about the syntax of the function print, it speaks that I c ... s correspondente é', meses(mes)) else print('o calendário só tem 12 meses') end What Would the correct syntax look like?

Export an array of matlab data to excel

I have a file with multiple arrays as described: Name Value lat <162x168 single> lon < ... e> I want to send this data to excel or cvs. I tried several commands without success. Has anyone ever done this export?

trapeze rule in matlab!

Good Night. Could someone help me? I need to create a function in matlab that solves integrals by the "compound trapezoid rule". I know how the "trapeze rule" works, but how to do the implementation in matlab?

Represent coordinates in Matlab vector

I'm having trouble creating an object vector in Matlab, the idea is that it's a coordinate vector, i.e. the X and Y positions ... the vector instance in another class, which will have to have in the constructor the allocation of this array of n positions.

How to generate sound in matlab from a wave?

If I create a sine wave: x=0:0.1:6*pi; is the range of the wave y=sin(x); is the wave with amplitude 1 f=440; is the desired frequency How to generate a sound from this data? I tried sound(y, f), but it doesn't work. How to proceed?

How to change time, read and chart in MATLAB?

I am a meteorology student and I analyze data from micrometeorological towers. In each line of my file, .csv has Tower code, ... 23:59. 2º plot a graph and in my Xlabel have the time and that this time on the X axis is dynamic to my zoom (if necessary).

Translation of Matlab to R with system (sprintf())

I am trying to translate the following code from matlab to R: clear all nsta = [1,2,3]; npx = [2,3,4,5]; npu = [2,3,4,5]; ... on the seventh line, the error appears: Warning message: running command 'del MODEL1b.log' had status 127 How to proceed?

Distributing points evenly in a circle

I started making a code to randomly distribute points evenly in a circle, however, by generating a point located with a rando ... he points are evenly distributed: Pontos = R * sqrt(rand(1,N)) .* exp(j * 2 * pi * rand(1,N)); How can this be explained?

Mount an RGB matrix that is equivalent to a GrayScale with a changed color

I have a Matlab matrix of one dimension i.e. grayscale, only I would like to create an RGB equivalent in which every black of ... every zero is a shade of green. And that all other white and gray colors are kept from the original Matrix in the same color.

Newton Fractal, roots of equation Z^4=1

I want to plot a graph of an image, called Newton Fractal: Follows Model: The problem is to plot the roots of the equat ... for j=1:niter; end [X,Y] = meshgrid(x,y); Z(i,j) = f(x(i), y(j) ); end end surf(X,Y,Z) endfunction.

Plot a graph of the charging and discharging of a capacitor in MATLAB

I need to create a program that shows through the plot the charge and discharge of a capacitor as shown below: Are 3 con ... acitance; R = resistance E = source voltage (example; a 20V Source); I managed to make the load graph through this code:

Generate animation from graph [closed]

closed. this question is out of scope and is not currently accepting answers. ... , 1, n); surf(X,Y,B(:,:)); But how do I get it to generate an animation of the chart? I don't know anything about MATLAB...

Moving average calculation in MATLAB

How to calculate the average of 12 months of a time series in MATLAB, so that by fixing jan to ten the year you want the aver ... average of Feb of year x-1 to jan of year x and the month mar of year x will be the mean of mar of year x-1 to Feb of year x?

How to plot this sign in MatLab?

I wanted to plot these signals in MatLab to make a fourier series, but I'm not getting it. Does anyone know is the mistake? A ... ); figure; plot(t,x_aprox_0); plot(t,x_aprox_1); plot(t,x_aprox_2); plot(t,x_aprox_3); plot(t,x_aprox_4); hold on; grid on;