# Questions tagged [matlab]

MATLAB is a commercial numerical computer algebra system

589 questions
Filter by
Sorted by
Tagged with
78 views

### MATLAB Fourier: Why do I see less harmonics the more I increase the sampling frequency?

I made MATLAB calculate the Fourier transform of these square wave pulses which have a frequency of 60Hz. I do not understand why, the more I increase the sampling frequency, the less visible the ...
1 vote
49 views

### Changing the Limits of the Graph When Trying to Model the Shockley Equation in MatLab Shifts the Position of the Curve [closed]

I have been trying to create a piecewise linear model of a diode through curve fitting. While trying to implement the code below, I ran into a strange bug that is causing my output curve to shift to ...
• 27
40 views

### Matlab simulation of PCB IFA

I am designing a PCB IFA and to get used to simulating it later down the road, I decided to first simulate an existing, known working design. Known design for 0.062" Substrate (page 3) This is ...
• 444
51 views

### Three-phase controlled rectifier power reversal issue in MATLAB Simulink

I have built a fully controlled three-phase rectifier in MATLAB Simulink. Now according to theory for RL load as I increase firing angle from 90 deg to 180 deg, the output voltage should become more ...
42 views

### Plotting the bode plot of a high pass filter using matlab

I am trying to theoretically find the frequency response of the circuit given below: Firstly i found the impedance value of the RC Ladder by applying the equation below, then i defined this as "...
20 views

### Simulink Simscape Motor Blows Up with Torque Feedback

I am trying to simulate a DC motor using the Simscape -> Electrical -> Specialized Power Systems. I try to simulate an increased inertia by using $\tau=J\frac{d\omega}{dt}$ where $\tau$ is ...
• 703
79 views

### How can I use MATLAB to show that the Doppler effect destroys orthogonality of OFDM subcarriers?

I am trying to get a visual representation of how the Doppler effect destroys the orthogonality of the subcarrier and understand this effect. I plotted three orthogonal subcarriers in MATLAB: ...
71 views

### Different frequency responses for series RLC series circuit using Multisim vs. MATLAB

I have been trying to simulate the following RLC circuit: When I simulated in Multisim Live I obtained the following frequency response, which I expected based on the values I used to calculate ...
• 27
1 vote
94 views

### How to obtain the pole zero map and step response of the 2nd order system and determine the mode of damping in the system using MATLAB?

$$\frac{C(s)}{R(s)}=\frac{\omega_n^2}{s^2+2\zeta \omega_n s+\omega_n^2}$$ Obtain the pole zero map and step response of the 2nd order system and determine the mode of damping in the system. If the ...
1 vote
145 views

### How to go with this RC circuit?

So, i've been asked to get the differential equations (or model) for this circuit: V1=15 u(t)V, R1=10 ohm, R2 = 20 ohm, C1=10uF, C2=20uF I'm just a beginner, and don't know if the differential ...
26 views

### How to determine the values of transportation delay blocks and step block in block diagram?

What are the values of transportation delay blocks and step block in this block diagram to get Motor speed Graph for KI = 1.0s−1, KP = 0.3 and time delay = 0.046?
87 views

### 34401A Remote Measurement Time

I am using an HP 34401A as an ADC for data acquisition. I am triggering the device within a 'for' loop in MATLAB, so that I can synchronize the measurement with a separate device. I am able to collect ...
92 views

### Reference Voltage Tracking for DC-DC boost converter

I have a boost converter which works perfectly with an s-domain controller (using a type-3 compensator and dual loop). Now, I need to do this using digital control (z-domain). I have converted the s-...
131 views

### Why does my MATLAB calculation/simulation differ greatly from my LTspice simulation?

Here is my circuit in LTspice. The frequency AC is here: This is DC with .op command. --- MOSFET Transistors --- Name: m1 Model: nmos-sh Id: ...
• 907
1 vote
32 views

### Problem with Arduino Uno sending data to MATLAB

I am sending data from an Arduino Uno to MATLAB. Below is my Arduino and MATLAB code: Arduino Code: ...
• 365
131 views

### How to find poles and zeroes in this kind of transfer function?

How do I find poles and zeroes from this complex transfer function? $$H(s) = \frac{2959}{100\,s} - \frac{ 171\, \Gamma\left( \frac{7447}{10000} \right)} {200\, s^{7447/10000}}$$ I used the ...
• 25
74 views

...
125 views

### Issue with 3rd order Butterworth low pass filter simulation

I wrote up some code in MATLAB that's supposed to simulate the frequency response of a third order passive low pass Butterworth filter with a cutoff at 10kHz. The curve seems to match the results I ...
99 views

### Why are the current-voltage characteristics of a bipolar transistor in MATLAB and LTspice different?

I simulated the 2N5089 bipolar transistor in both programs. The output I-V curve is completely different, although both programs use the Ebers-Moll model. Spice-model of the transistor: ...
• 21
158 views

### LTSpice PMOS model differs from by scratch implementation

I have this circuit in LTSpice to test a PMOS model: and this matlab function that implements a basic pmos with the characteristics equations: ...
• 23
53 views

### Solver settings for buck converter simulation in simulink

I am trying to simulate a buck converter in simulink to operate at a 200 kHz switching frequency. The compensator settings that I am using are shown below - The desired input and output voltages are ...
23 views

### Why I am not getting same values for exported simulink variables as stepinfo?

I am using MATLAB 2015a and I am trying to get stepinfo parameters of output that was exported from Simulink to MATLAB workspace but I am not getting same values as if try to get stepinfo for MATLAB ...
• 45
1 vote
89 views

### Incorrect cutoff frequency using two Sallen-Key filters to build a bandstop filter

I'm currently having trouble troubleshooting my answer. I have to make a bandstop filter that has a cutoff frequency of 100 rad/s, and 10^6 rad/s using two Sallen-Key filters. I made the low and high ...
• 11
46 views

### How can I correlate a RSSI value to a distance measurement more efficiently?

I want to develop a trilateration algorithm using 3 fixed advertising beacons in different parts of a room and a mobile receiver which continuously gets the RSSI values of the 3 fixed beacons and ...
• 65
32 views

### simulink model where series capacitor is used as facts device

I have no clue what is going on in the following simulink model. I don't know how to give the input, check which scope for the output, nothing. I have no clue where the series capacitor is being used ...
86 views

### Simulink sample time error when modeling analog circuit

I’m trying to model a CMOS inverter as an ANALOG device (and, as far as I can tell, the input signals are all continuous time blocks), but I keep getting an error about sample time, which is weird ...
135 views

### Linear line on loglog plot

I'm trying to plot a -20dB/dec line on MATLAB but can't seem to get it correct. I know that a linear line in a loglog plot is actually an exponential curve in the linear scale. So writing a y = mx + ...
• 406
21 views

### Effect of 2ASK Sampling Points on Bit Rate

“I reduced the only one sampling points while using 2ASK modulation, and the bit error rate increased by 20%. Can you help me with this?” Question happens in this line: ...
1 vote
64 views

### Wrong plot for Ids for output characteristics (MOSFET), does new graph look reasonable?

EDIT: This is not a duplicate of 'Wrong graphs for Ids'. That one focuses on the transfer characteristics, while this one addresses the output characteristics. This distinction was also mentioned in ...
• 31
1 vote
110 views

### Wrong Graphs for Ids (MOSFET)

EDIT: I have now obtained this graph, using the suggested changes. Does it look reasonable? And this one maybe more clearer: I'm writing a MATLAB script that employs Shockley's model to derive the ...
• 31
47 views

### Confusion regarding simulation in Simulink?

Please check the attached snap especially the portion in red marked area, which is simulation stop time and it has default value of 10? Is it 10 second or any other unit? According to my experience, ...
• 1,219
1 vote
41 views

### How to determine beamforming pattern?

I have a beamforming vector, which includes amplitude and phase information. How can I determine the corresponding beamforming pattern for the antenna and plot it in Matlab? For example, I have a ...
72 views

### Type 3 compensator with opamp compare calculation/simu and measured difference

I'm designing a type 3 compensator with an opamp for a flyback which is operating in a constant voltage mode. Therefore I measured the plant and started to design a suitable type 3 compensator to ...
• 31
136 views

### Why does MATLAB show a pole in bode plot of an underdamped second order system at natural frequency?

I am using the sisotool in MATLAB to obtain the bode plot of the following transfer function: MATLAB marks a pole at wo which is approximately 11.18 What is the meaning of this? How would you even ...
201 views

### Quick PMSM FOC PI controler design

For a Simulink Model I am looking for a quick and easy way to estimate PI-controller parameters for a speed control loop and Id and Iq controler of a PMSM using FOC. I don't have a real motor just the ...
• 147
60 views

### Stuck during designing a PI Controller

I'm trying to design a PI Controller on the basis of this paper: "Design of robust PI control systems based on sensitivity analysis and genetic algorithms." by Jau-Woei Perng • Shan-Chang ...
41 views

### What kind of model can be used to simulate over- and under voltage in a Li-Battery pack?

So far I have not much experience with modeling in the field of lithium-ion cells or batteries except equivalent circuit models (ecm)-models which I've implemented and used for simulations in Matlab/...
• 185
67 views

### Plotting the radiation pattern of a half-wave dipole antenna with a frequency of 144 MHz in MATLAB

I need to plot the radiation pattern of a half-wave dipole antenna with a frequency of 144 Mhz in MATLAB but I don't know the code, can someone please help me?
• 1
1 vote
321 views

### What is the Z transform of the discrete PI control model？

I have a discreate PI controller implemented in stm32 MCU, it has the following form: $$PI=K_p\cdot[r(t_i)-y(t_i)] + (K_I)\cdot\sum_{n=0}^{i}[r(t_n)-y(t_n)]\cdot\Delta t$$ where $r(t_i)$ is the ...
• 11
115 views

### Rotated gyroscope 180 degrees but integration shows 90

I'm a student new to sensors. I'm currently calibrating the gyroscope from the following IMU: ICM42670. I was able to get the bias by leaving the gyro for some time and getting the average of the ...
• 29
71 views

### pulse generator MATLAB

How to create a rectangular waveform with amplitude 18 to -3 using pulse generator? If I put 18 as the amplitude then the wave is between 18 and 0. How do I change that to 18 to -3?
49 views

### How to have sharper rise for ideal filter frequency response in matlab

I am writing about analog filters in my blog and I decided to plot the frequency responses using matlab, representing the responses using step functions. But matlab uses heaviside function which does ...
263 views

### Solving for Normalised Frequency with LLC Gain Equation

I would like help solving the equation below for Fn within matlab or Octave (preferably). What I know is the following: MG = 1.3 QE = 0.52 LN = 3.5 Because I am following this reference(https://www....
• 180
57 views

### How to obtain a bode plot for this circuit in Matlab online version

So I've an electrical circuit in matlab as follows: I've already setup the points of linear analysis. But I can't the option for linear analysis in the linearization tab. The problem is that I cannot ...
• 185
63 views

### Phase Coefficient versus frequency plot

I have been asked to confirm that the propagation characteristics of a transmission line, with the given parameters R= 2.2 Ohm, L = 105nH, C = 69pF, G = 14 nS. Along with these two equations, I have ...
102 views

### Three-Phase Thyristor Bridge Converter Simulation on Matlab

I am looking for a 24 pulse rectifier to power an electrolyser using a universal thyristor bridge from matlab. I am using a phase shifting zig zag transformer for this. The transformers are shifted by ...
132 views

If the input is zero here, how was the response on the right obtained? Also, how was gain block changed to equal to τ? Please note this is a first order system with the equation dx/dt = 1/τ(u-x)
• 185
1 vote
143 views

### How to do Phase Resolved Partial Discharge (PRPD) analysis using MATLAB and Simulink?

I've been asked to simulate a model in Simulink for Phase Resolved Partial Discharge (PRPD) Analysis for an input signal and store the output data from the model in a file (in txt/csv/excel format), ...
1 vote