Conversion of .slx file to .mdl format?

조회 수: 2 (최근 30일)
ABTJ
ABTJ 2021년 4월 3일
댓글: DGM 2021년 4월 4일
I am right now using MATLAB 2011 ,but i have a simulink file,sampling.slx(link given below)that i am unable to open,can some one please convert that to .mdl format,so i may use it in MATLAB 2011?
Thanks in advance

답변 (1개)

DGM
DGM 2021년 4월 3일
I don't know if there are specific version dependencies between R2011a and R2011b, so I just did both. I didn't try to run any of them, so no guarantees anything works.
  댓글 수: 2
ABTJ
ABTJ 2021년 4월 4일
편집: ABTJ 2021년 4월 4일
Many thanks for your kind response, When i try use,it is opening in simulink,nice,but when i try to call it through M-file,i get the following error:
Error using sampling_m_file (line 28)
All sample times for 'sampling_R2011a/Spectrum reconstructed signal/Optional Buffering/Buffer' must be
discrete.
No continuous or constant sample times are allowed
Code of m-file is below:
% f - The frequency of analog sinusoid signal
% F - Sampling Rate
% qbits - Number of Quantization bits
% A - Amplitude of sinusoid signal
% L - Number of quantization levels based on qbits
% I - Quantization Interval
% sim_time - Simultaion Time
% span - x-axis range of frequency plot 1 & 3 (spectrum scope 1 & 3)
% span1 - x-axis range of frequency plot 2 (spectrum scope 2)
% NFFT - Number of FFT points
clc;
clear;
close all;
f = input('Enter the frequency of signal = ');
F = input('Enter the sampling frequency = ');
A = input('Enter max amplitude of signal = ');
qbits = input('Enter the number of quantization bits = ');
fc = input('Enter the lowpass filter cutoff frequency = ');
L = 2^qbits;
I = 2*A/(L-1);
% Settings for Spectrum Scope
span = 9*F;
span1 = 9*F;
NFFT = 256;
% To run simulink model
t = 1/f;
sim_time = 10*t;
sim('sampling_R2011a.mdl');
DGM
DGM 2021년 4월 4일

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Signal Generation에 대해 자세히 알아보기

제품


릴리스

R2011a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by