已回答
How i can remove inf value and zero value in 10x10 Matrix?
I assume you want the finite values which are not zero? A % input Matrix nonZeroValues = A(A~=0 & isfinite(A)); to get ...

9 years 前 | 0

| 已接受

已回答
Fill a line with tabs until specified length is reached
I think an easy way is to write your own function for this. function str = myStr(InputStr,len) str=InputStr; lenDiff...

9 years 前 | 1

已回答
How do I save value of variable in matrix form, which is overwritten after each iteration in for loop?
You can save the values in a cell-array. As described in the following answer <http://ch.mathworks.com/matlabcentral/answers/25...

9 years 前 | 0

| 已接受

已回答
How to make variable in Simulink, which few elements contains?
In a simulink model you can specify callbacks. In this callbacks you can place your variable declaration. In the menu "Flie"...

9 years 前 | 0

已回答
Retrieve the time that a certain value is reached within a time series.
A simple way is to extract the data and the time as arrays % create example data d=1:100; t=d/100; ts = timeserie...

9 years 前 | 0

| 已接受

已回答
choose one out of every 8 elements randomly
m = 21; A = (1:m)+0.314; nof8 = ceil(m/8); randSelect = randi([1 8],1,nof8); inds = randSelect+(0:nof8-1...

9 years 前 | 1

| 已接受

已回答
Split signal if there are zero values
s1=[0,1,2,5,0,0,5,3,0,0,0,0,3,4,1,2]; signalID = cumsum([0 diff(s1)>4]); nofSignals = signalID(end)+1; for i=...

9 years 前 | 0

| 已接受

已回答
Rate Limiter per minute
You can use the 'Tapped Delay' block to generate an array with the last N values. With two 'MinMax' blocks you can calculate the...

9 years 前 | 0

已回答
How to filter an array?
A = [0;0;0;0;0;0;1;1;1;0;0;0;0;0;0;1;0;0;0;0]; % A = [0;1;1;0;1;1;1]; dA = diff(A); ind = 1:length(A); sta...

9 years 前 | 0

已回答
Can you make matlab do a beep every 5 seconds?
i=0; load gong.mat; while i<1 %endless loop sound(y); pause(5); end It is also possible to use the 'beep...

9 years 前 | 1

已回答
How can I repeat the following text 5000 times ?
Put the code in a scriptfile (e.g. doThisCode.m) and call it from anotherone with. for i=1:5000; doThisCode end Thi...

9 years 前 | 0

| 已接受

已回答
How to create a model in Simulink from Matlab?
You have to add inports and outports to the subsystems. add_block('built-in/Inport', [modelName '/' subsystemName '/' portNa...

9 years 前 | 0

已回答
Possible to run Stateflow at 'same' speed as Simulink?
In Stateflow you design a state-machine and to change from one state to another you need one tick (sampletime step). If you don...

9 years 前 | 0

| 已接受

已回答
Is tit possible to connect a push button to source?
You can use a Constant-Block (name it myRandInput) and change the value of this block over the OpenFcn (open function callback) ...

9 years 前 | 1

已回答
save a for loop
If you want to use a for-loop you can use this adaption of your code: text1 = ' i want to do my thesis as well as possible '...

9 years 前 | 0

| 已接受

已回答
Does Simulink project git version control only work when the *.prj and .SimulinkProject are placed in the root of the repository?
I had the same question and got this answer: We do not support the feature for Git. Our development is aware of this limitat...

9 years 前 | 0

已回答
Way to break matlab code string into array of sections
You can try something like this: result = regexp(str,'^%%','split','lineanchors')

9 years 前 | 0

| 已接受

已回答
What command can I issue to list my custom enumerations which are currently residing in Matlab?
A little bit late, but maybe you are still looking for something. I use the following code to get an overview of the defined en...

9 years 前 | 7

| 已接受

已回答
How to edit the internal properties of any simulink block using only matlab code?
I think this is what you'r looking for: block = add_block('built-in/Step', 'Test2015a/myStep','Position',[ 450 375 500 425]...

9 years 前 | 0

| 已接受

已回答
What command do I use to assign a range of values or a set of specific values for K?
Please Tag your questions with homework. Please post your code in a readable way (Code). You have an error in your transfer ...

9 years 前 | 0

已回答
Check if number in Row, if not delete the complete column
You can try this mask = cellfun(@isempty, TestData); deleteColumn = sum(mask)>0; TestData(:,deleteColumn) = []; ...

9 years 前 | 0

已回答
Comparing two .SLX files without Report Generator Toolbox
Hi, I think with the binary files you can get a better performance, but I don't know all the reasons why they changed the file ...

9 years 前 | 0

已回答
Detecting Bus Selector missing input signal
a fast hack is shown in this code snippet: busselectors = find_system(gcs, 'FindAll', 'on', 'BlockType', 'BusSelector') ...

9 years 前 | 1

已回答
How do I write the scrip for this problem? The one I wrote doesn't give me the same answer. Every tutorial I watched hasn't helped.
Td = A/s is already the step function. figure; for KK = [1 5:5:25] Gc=tf([1 0],[1 4 9 KK]); t=[0:0.1:10];...

9 years 前 | 0

| 已接受

已回答
Finding Simulink block by sample time
try this: find_system(gcs, 'FindAll', 'on', 'SampleTime', 'inf') where gcs means get current system and could also be re...

9 years 前 | 1

| 已接受