이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
Cannot connect to model 'time_simulink'; please try Update Diagram (Ctrl-D). Caused by: Error in 'time_simulink/Upsample': All sample times for this block must be discrete. C
조회 수: 7 (최근 30일)
이전 댓글 표시
Fayaz
2023년 6월 17일
Caused by:
- Error in 'time_simulink/Upsample': All sample times for this block must be discrete. Continuous sample time is not allowed.
채택된 답변
Daniel
2023년 6월 17일
You're trying to upsample a continuous input. The input has to have a discrete sample time before it can be upsampled. The sample time is the period (in simulated time) between updates to the signal. E.g. a sample time of 0.2 would mean that the signal value changes at time 0, 0.2, 0.4, etc.
If the input to your upsample block is an inport, you can set a sample time under the Execution tab.
If the input to your upsample block is a constant, you can set a sample time under the Main tab.
If the input to your upsample block comes from other signals within the system, you can use a Zero-Order Hold (from the Simulink/Discrete library, among other places) to make the output have a discrete sample time.
If you post your full model or more context, we will be able to provide a more targeted suggestion. For instance, what kind of signal is going into the Upsample block? Where does it come from? What are you intending to accomplish? Is the system intended for code generation?
댓글 수: 20
Fayaz
2023년 6월 23일
im taking the input form the matlab workspace. The workspace element is an LTE filtered waveform. so it is complex double value. i separated the real and imaginary value and converted to timetable objects. those timetable objects are fed to the inport blocks. then upsample block does it work and produce an ouput in the matlab workspace. finally compare the simulink upsample block output and matlab script output are same or not.
% clear
close all
clc
% 5MHz carrier
fs = 7.68;
tdw=LTE5_3_1.waveform;
%% SHOLDER REMOVING
shape5_out = conv(tdw,shape5);
% first 5 samples
shape5_out_5 = shape5_out(1:5);
%% timetable convertion
% Create a time vector
t = 1:5;
shape5_out_100_real = real(shape5_out_5);
shape5_out_100_imag = imag(shape5_out_5);
%% Create the time vector
t1 = seconds(1:5); % Convert the time vector to duration format
%% Create timetable objects for real and imaginary waveforms
shape5_out_T_real = timetable(t1', shape5_out_5_real, 'VariableNames', {'Real'});
shape5_out_T_imag = timetable(t1', shape5_out_5_imag, 'VariableNames', {'Imaginary'});
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1418213/image.png)
Daniel
2023년 6월 23일
You're running into issues because your inports don't specify a sample time. When you pass a timetable into Simulink, it assumes the timetable is a sampled representation of a continuous signal. It doesn't infer a constant timestep, which is needed for a block like Upsample to make sense.
You need to open up each Inport and set the sample time (under the "Execution" tab) to some discrete value. I would recommend that you create a "Ts" variable in your MATLAB script, representing the timestep in your timetable. Then you can set each Inport's Sample time parameter to Ts.
You can also pass the data in as a complex value, as far as Simulink is concerned. There's no reason (as far as I can tell) to break the complex signal into real and imaginary components and re-mix them in the model, unless the script you're using is a proxy for some system that starts with separated signal components.
Fayaz
2023년 6월 24일
Im a beginner in matlab, so if im not able to make it done, can you help me to solve through guiding.
Fayaz
2023년 6월 24일
You need to open up each Inport and set the sample time (under the "Execution" tab) to some discrete value. I would recommend that you create a "Ts" variable in your MATLAB script, representing the timestep in your timetable. Then you can set each Inport's Sample time parameter to Ts.
for this case, you can see, i have defined 't1' for timesteps in the timetable. so can i use 'Ts=1' as sampletime in the inport block parameter setting? because my timetable step size is 1 and then im getting an error like,
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1418353/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1418358/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1418363/image.png)
Daniel
2023년 6월 24일
Yes, Ts=1 should be fine.
However, if you're getting an error related to fixed-step size, you've made a few other changes to the model since last time you submitted it. Since you're targeting HDL code, run hdlsetup on your model. I.e., hdlsetup coming_upsample_in_out_ports or hdlsetup(bdroot). That will get the model solver set up properly and fix the "Invalid setting" error you're seeing.
Fayaz
2023년 6월 24일
thanks alot brother. it works and generate hdl code. hats off to you. i was trying to fix this error for a long time.
Fayaz
2023년 6월 24일
in futture i really need your help to complete my undergraduate project. is it ok for you? i would never forget your help and grateful to you.
Fayaz
2023년 6월 24일
// -------------------------------------------------------------
//
// File Name: hdlsrc\coming_upsample_in_out_ports\coming_upsample_in_out_ports.v
// Created: 2023-06-24 22:03:44
//
// Generated by MATLAB 9.14 and HDL Coder 4.1
//
//
// -- -------------------------------------------------------------
// -- Rate and Clocking Details
// -- -------------------------------------------------------------
// Model base rate: 0.5
// Target subsystem base rate: 1
//
// -------------------------------------------------------------
// -------------------------------------------------------------
//
// Module: coming_upsample_in_out_ports
// Source Path: coming_upsample_in_out_ports
// Hierarchy Level: 0
//
// -------------------------------------------------------------
`timescale 1 ns / 1 ns
module coming_upsample_in_out_ports
(In1,
In2);
input [31:0] In1; // single
input [31:0] In2; // single
endmodule // coming_upsample_in_out_ports
############################## IT GENERATED THIS KIND OF VERILOG HDL CODE. IS THIS OK?
Fayaz
2023년 6월 25일
one another huge help please. i have to build the hdl block set for NCO(frequency shifting). so i selected a HDL NCO block but i dont know how to set the parameter configuration according to my script. i have through the MATLAB simulink HDL guide, but i could not understand. i will attch the details can you help me to do that. Also i have attched the workspace for the script. please be kind enough to give a support
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1418858/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1418863/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1418868/image.jpeg)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/1418873/image.jpeg)
Daniel
2023년 6월 26일
If you have a question on the NCO, it will be better to file that as a separate question. That way the question will get a fresh set of eyes on the forum, and the answer will be a lot easier for others with the same question to find as well.
Fayaz
2023년 6월 30일
sir , do you have tie to check out this NCO problem, thats kind nore difficult part to me
Fayaz
2023년 7월 3일
sir, im around the corner for my submission, can you be pleased to give support . i would be grateful to your support
추가 답변 (0개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom(English)
아시아 태평양
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)