# Questions tagged [matlab]

MATLAB is a commercial numerical computer algebra system

387 questions
Filter by
Sorted by
Tagged with
1k views

### How to control an LED light by the output of a matlab program?

In my project, I'm designing the software to control a door using fingerprints, so I have 2 possible outputs: 1-door open, 2-door not open. I need to change this output to an LED as an example (red ...
2k views

### Why is MATLAB used so much in industry when there's other software that can do a better job? [closed]

All the classes I'm taking require the projects to be done in MATLAB when there are times that C++ would be much better to use. One time the professor took three hours to find a transfer function when ...
278 views

### Voltage form at diode bridge

I want to find the output voltage of a circuit like this: and this is my Matlab code to solve it: ...
2k views

### Simulating PID controller in Matlab

I am trying to explore PID control with a simulation. My problem is that the derivative term does not behave as expected in my simulation: No matter how large its coefficient it seems unable to ...
93 views

### Downsample vs custom latency register

Is there a difference between downsample block (eg. in matlab) versus a register with custom ...
722 views

### For loop does not compile in Matlab mcode using Xilinx block

I have a simple code in xilix type mblock in simulink: function q = test1( n) q = 0; for i = 1:n q = i; end; end If I run this code naively in matlab ...
2k views

### Finding Thevenin equivalent

I'm looking to find the Thevenin equivalent of two parallel voltage sources where each source has some internal resistance as well for simulation in Matlab. I don't know where and how exactly to put a ...
3k views

### Estimating a sinc period and width of a rectangular pulse

For a rectangular pulse that has as a fourier transform of a sinc function like so: How can I estimate its sinc period in the frequency domain and compute the width of the rectangular pulse in the ...
878 views

### How can I model this linear power system in MATLAB?

For my power system, let us suppose it has the following dynamic model: $\ x ' = f(x,u)$. This dynamic model consists of four first order differential equations (see below). Then, I linearized ...
770 views

### Coherence factor in Delay-And-Sum-Beamformer: Triangle Inequality

I'm writing a delay-and-sum-beamformer in MATLAB that incorporates a so-called and widely used coherence factor CF. Now I'm confused about the math behind that ...
1k views

### How to implement a control system

I have designed a Control System and don't know how to implement it. I have modeled the physical system and have designed the control based on the State Space method. The state space form is as ...
126 views

### Another matlab figure question [closed]

I want to graph $h[n] = \frac{1}{n+1} \ n\in [0,29]$ I tried the next code, but won't compile: ...
3k views

### Incremental optical encoder output to Matlab Simulink

I'm doing a project based on an incremental encoder based position sensor. In order to validate this, I'm trying to read square wave signals from a function generator (since an optical encoder ...
939 views

264 views

### A question on Simulink [closed]

I've done a simulation with Simulink. Now I want to do the next thing: extract the specific graph that I want and to mark some point on the graph that it will be displayed. like in the next pic: ...
691 views

### Using Matlab to draw a step response graph

I've got the next transfer function: $$\frac{\hat{\alpha}}{\hat{\alpha_{ref}}} =\frac{w_n^2}{s^2+2w_n \xi s+ w_n^2}$$ Now I want to draw a step response input at height of $\alpha_{ref}$, where \...
4k views

### Calculating SNR for ADC samples

I have collected some samples for a 200Hz sine wave using an AVR microcontroller. I would like to quantify the performance of the ADC using the signal to noise ratio measurement. Theoretically, for an ...
152 views

### Determing the Phase Angle of the following code: [closed]

I'm trying to determine the phase of xx after the code is run. You shouldn't need to actually run it to determine it however, as it is unclear on the graph. The two phases present appear to be (-3*j) ...
457 views

### Determining parity or FEC (Forward Error Correction) requirements from percent error

I am very new to signal processing and my background is in physics. I would like to know if it is possible to determine the number of parity bits needs to theoretically get 100% transmission from a ...
649 views

### Help finding transfer function for root locus using Matlab

I'd like to pick $k_d$ using root locus method, but have problems deriving the necessary transfer function of the system presented below. Assume $k_p$ is fixed. The question originates from Randal ...
1k views

### Brushless motor controlled via current source math model

I'd like to model a brushless motor's (BLDC) dynamic response using Matlab. I'm controlling the motor by an Elesctonic Speed Controller (ESC). I'd like to derive a transfer function of such a circuit ...
3k views

### 'feedback' function in MATLAB

How do I use feedback function in MATLAB when I have sys1 and sys1 as impulse responses (and ...
24k views

### Matlab and RLC analysis

I'm trying to plot the response of a series RLC circuit to a step function using Matlab. I've read a bit around it, but I can't get it to work. Help would be much appreciated. Here is my Matlab ...
311 views

### pic18f flooding serial with zeros when reset

I'm connecting a pic18f4520 to the pc via serial (and then use Matlab). I used the max232 level converter and the echo test worked fined. However when I reset the pic it floods the connection with ...
5k views

### How do I produce a linearly chirp signal in spice?

I want to produce a chirp signal to test my PLL and found out the lock range. There is the PWL and ...
2k views

### sending data over bluetooth to my hardware through a matlab serial GUI

I have a hardware with RN-41 bluetooth module and the lpc 214 arm microprocessor.Currently my device only sends data to the PC and I am trying to configure it to be able to receive some commands over ...
2k views

I generated C code from a Matlab-Simulink model (In Matlab help is "Parametric Audio Equalizer" -> "Task 6 - Integrate Device Drivers" -> "Configuration C") with a "Target Preferences" module for ...
2k views

### How to go from Matlab to Filter?

I design a filter in Matlab using these command: Fs = 2.5*10^10; n = 2; Wn = 5000/Fs; [b,a] = butter(n,Wn); and get ...
1k views

### Generating C code from a Matlab-Simulink model for DSP C6748

I'm trying to generate C code from a Matlab-Simulink simple model (eg.: sine wave generator with a DAC at the output). This code must be executed with Code Composer Studio for TMS320C6748 DSP (Texas ...
609 views

### Fixed Point MATLAB DSP Algorithm

I've got a question about coding an algorithm for a Texas Instruments TMS320C64xx DSP in MATLAB: I've got a working sloppy implementation of my filter in MATLAB. My goal is to use MATLAB Embedded ...
837 views

### Complementary Code Keying

Asked the question here : I would like to understand Complementary Code Keying. How modulation and demodulation is done ? How higher data rate is achieved using CCK modulation in IEEE 802.11b ? ...
3k views

### Video & image processing in Spartan-6 FPGA

I'm very new to FPGA. I got a Spartan-6 from Digilent. As my final year project I want to do image processing through it. How can MATLAB & Simulink be used for this? How should the camera be ...
52k views

### How to do circuit analysis using Matlab?

I often hear of people using Matlab for circuit analysis, but I never actually figured out how it is done. I assume that there is something more to it than just setting up equations by hand and ...
1k views

### MATLAB programming of Particle Filter - what is going wrong?

I'm working on a particle filter experiment for multi-sensor fusion and I just programmed it in MATLAB. However, I get very low accuracies for my final values. Plus, I read a lot of literature where ...