Answered
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 ...

8 years ago | 0

| accepted

Answered
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...

8 years ago | 1

Answered
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...

8 years ago | 0

| accepted

Answered
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"...

8 years ago | 0

Answered
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...

8 years ago | 0

| accepted

Answered
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...

8 years ago | 1

| accepted

Answered
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=...

8 years ago | 0

| accepted

Answered
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...

8 years ago | 0

Answered
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...

8 years ago | 0

Answered
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...

8 years ago | 1

Answered
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...

8 years ago | 0

| accepted

Answered
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...

8 years ago | 0

Answered
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...

8 years ago | 0

| accepted

Answered
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) ...

8 years ago | 1

Answered
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 '...

8 years ago | 0

| accepted

Answered
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...

8 years ago | 0

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

8 years ago | 0

| accepted

Answered
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...

8 years ago | 6

| accepted

Answered
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]...

8 years ago | 0

| accepted

Answered
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 ...

8 years ago | 0

Answered
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) = []; ...

8 years ago | 0

Answered
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 ...

8 years ago | 0

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

8 years ago | 1

Solved


Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

8 years ago

Answered
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];...

8 years ago | 0

| accepted

Answered
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...

8 years ago | 1

| accepted