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
27 次查看(过去 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!发生错误
由于页面发生更改,无法完成操作。请重新加载页面以查看其更新后的状态。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 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 (한국어)