現在この質問をフォロー中です
- フォローしているコンテンツ フィードに更新が表示されます。
- コミュニケーション基本設定に応じて電子メールを受け取ることができます。
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
6 ビュー (過去 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'});

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,



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




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!エラーが発生しました
ページに変更が加えられたため、アクションを完了できません。ページを再度読み込み、更新された状態を確認してください。
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の 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 (한국어)