回答済み
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年弱 前 | 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年弱 前 | 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年弱 前 | 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年弱 前 | 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年弱 前 | 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年弱 前 | 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年弱 前 | 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年弱 前 | 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年弱 前 | 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年弱 前 | 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年弱 前 | 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年弱 前 | 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年弱 前 | 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年弱 前 | 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年弱 前 | 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年弱 前 | 0

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

約9年 前 | 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年 前 | 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年 前 | 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年 前 | 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年 前 | 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年 前 | 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年 前 | 1

解決済み


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

約9年 前

回答済み
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年 前 | 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年 前 | 1

| 採用済み