Answered
Convert range of signal values to constant by Simulink
I don't think there is a readily available block that can do the task for you. But I think you can construct a system to do that...

15 years ago | 0

Answered
Triggering a subsystem to run for set duration
I am not fully understand your question. Let's see if this is the case. Set your simulation step size as 0.01 second. Drag a "P...

15 years ago | 0

Answered
Embedded function (Simulink)
Drag and drop the "Embedded MATLAB Function" block from library "Simulink","User-Defined Functions" to your model and copy then ...

15 years ago | 1

| accepted

Answered
fprintf end of line character
What text editor are you using to view your text file? You need your text to appear in separated lines, right? Otherwise, you co...

15 years ago | 0

Answered
strings and numbers from excel
Use the third returning argument of xlsread() [NUMERIC,TXT,RAW]=XLSREAD(FILE) I always prefer this way because then I ca...

15 years ago | 0

| accepted

Answered
Custom Data Type in arrays
Is BalisesPosition a signal or parameter? If it is a parameter, BalisesPosition=Simulink.Parameter; BalisesPosition.V...

15 years ago | 0

| accepted

Answered
how to setup matrix with random unique combinations
a=eye(4); b=randperm(4); c=a(b,:)

15 years ago | 0

| accepted

Answered
Get the Simulink block's handle of the block under the mouse
gcbh() is the command to get the block handle if the block is selected. You might want to refer to <http://www.mathworks.com/m...

15 years ago | 0

Answered
Best way(s) to master MATLAB?
If you already have Matlab installed, type 'demo' in Matlab command window. Select 'Matlab' at the left column and you'll see th...

15 years ago | 15

Answered
Add a known column to a matrix 'n' times without a loop?
help repmat

15 years ago | 1

Answered
matlab based applications
You can compile your m-file to .p file. help pcode You can also compile your m-file to .exe file if you have the Matlab ...

15 years ago | 0

Answered
Model initialization inputs vs RTW C code
Let's say you have K1 and K2, two tunable constants for the gain value of two Gain blocks. You have K3=ComplexFunction(K1,K2) as...

15 years ago | 0

Answered
reshape,ascii to binary
y=x'; xx=y(:)'

15 years ago | 0

Answered
Performing Action to ALL 'struct' Variables
Would this help? a(200).b=1; a(200).c=0; NewStruct=a(100:end); Or, Do you mean keep the struct variable name, not t...

15 years ago | 0

Answered
How to use horizontal sliders to slide and show multiple axes
I am not sure if it can be done. This post may give you an idea since your problem is that you don't have enough space in your G...

15 years ago | 0

Answered
Define Array data type
As it indicates, Simulink.AliasType allows you to designate MATLAB variables as aliases for signal and parameter *data types*. I...

15 years ago | 1

Question


Why do you come to "MATLAB Answers"?
My answer is 'abcdefghi'. Higher priority, more important one comes first. Post you answer. Maybe I can collect all of them and...

15 years ago | 22 answers | 5

22

answers

Question


Please vote if you DON'T CARE to have M-function in M-script
The issue is raised in <http://www.mathworks.com/matlabcentral/answers/7685-m-function-in-a-m-script> Or a previous discuss...

15 years ago | 0 answers | 1

0

answers

Question


Please vote if you DO NOT want to have M-function in M-script
The issue is raised in <http://www.mathworks.com/matlabcentral/answers/7685-m-function-in-a-m-script> Or a previous discussion...

15 years ago | 3 answers | 4

3

answers

Question


Please vote if you want to have M-function in M-script
The issue is raised in <http://www.mathworks.com/matlabcentral/answers/7685-m-function-in-a-m-script> Or a previous discussion ...

15 years ago | 3 answers | 28

3

answers

Question


M-function in a M-script
When I write M-scripts (It's a script, not an M-Function), sometimes I want to have a quick and dirty function, such as: test...

15 years ago | 2 answers | 3

2

answers

Answered
Cleaning up line routing
You mean when you select a few blocks and then group them? I am not aware of any automatic way to beautify the signal routing...

15 years ago | 0

Answered
Multiple date and time formats in .txt files
As long as you can read the date string correctly, you can write your code to choose one format and convert the other two. Once...

15 years ago | 2

Answered
Store several output matrices in a single matrix
You have a nested for-loop. You don't need the inner for-loop for this purpose. You have the variable "All_Data" set to be em...

15 years ago | 1

Answered
Matlab and Unix server - path issues when trying to create and save to folder from Matlab
My guess is that it is due to the difference of the file seperator for Windows (\) and Unix (/). But why it works for .pdf file ...

15 years ago | 0

| accepted

Answered
How can I display axis values as thousands, millions and billions instead of 10^3, 10^6 and 10^9?
One suggestion: y=1e6*(1:5); plot(y/1e6); ylabel('Million');

15 years ago | 0

| accepted

Answered
Determine if user presses cancel in print(g,'-dsetup')
Would printdlg(g) work? The user can set up options. Then, if "Ok" is clicked, the figure is printed. if "Cancel" is clicked, no...

15 years ago | 0

Answered
extracting into a text file
a=rand(512); dlmwrite('mytext.txt',a);

15 years ago | 0

| accepted

Answered
How do I load text stored in an external file and display it as an annotation in a Simulink models?
It is relatively easy to export all the annotations in your model to a text file for others to review. After the review is done,...

15 years ago | 1

| accepted

Answered
EXE file.
Assume you have your working M-file ready, you can try mcc -m MyMfile mcc is the command to run Matlab compiler, which is a ...

15 years ago | 0

Load more