Answered
Double Pendulum Simulation using Simulink
The best way for this is to use the Constant block. You can specify the value of the Constant block as "m1" where "m1" is the va...

6 years ago | 1

Answered
Different behaviour of hold on depending on order
Good catch! From the document of hold "If axes do not exist, then the hold command creates them." Without an existing axes, "h...

6 years ago | 0

Answered
HOW TO INCREASE NUMBER OF PORTS IN SCOPE IN MATLAB (2007)
Probably don't have that capability. The current Scope block is originated in R2015b. What you can do is to use a Mux block to ...

6 years ago | 0

Answered
Renaming files in a folder in bulk
>> name='AB007_group2_subject011_naive_day2_rawdata.mat' name = 'AB007_group2_subject011_naive_day2_rawdata.mat' >> name=...

6 years ago | 0

| accepted

Answered
how to save variables
xlswrite('MyFile.xlsx',[product, TIS, error, error2])

6 years ago | 0

| accepted

Answered
issue in find variable
floating point data precision issue. Below is an example, a and b are not equal even though all the visible digits are the same....

6 years ago | 0

Answered
How can i use If ... else loop inside function ?
If none of those conditions are met, you end up with z not assigned. give z a default value at the begining.

6 years ago | 0

| accepted

Answered
Does your maintenance include security updates
Yes. Pay attention to the Bell icon on the top right corner of your MATLAB. There will be a reminder/notification when there is ...

6 years ago | 0

Answered
Setting initial condition of simulink integrator through code
The error message says you have the dialog window open and changes have not been applied. Click apply or Ok and then proceed.

6 years ago | 0

Answered
How to send a value to position "i" from app designer to a constant block in Simulink that has 5 dimmensions?
It certainly can be done but I am not sure if it would be "better". Note you have to set 'Value' as '5', not 5. when you set t...

6 years ago | 0

| accepted

Answered
Simulink, data from vector representation.
The most common case, let's say you have a vector a=0:0.1:1. Make it a column vector b=a' Create a time vector to specify the ...

6 years ago | 0

Answered
Changing function packaging of Simulink Functions to inlined
Inline would make that block a regular subsystem block, not a Simulink Function. A Simulink Function is called by its name, so I...

6 years ago | 0

Answered
Reactivate Matlab with different license
Most likely, you won't be able to launch MATLAB on your slower computer. Otherwise, you could go to Help, Licensing, Activate So...

6 years ago | 0

Answered
Invalid expression. Check for missing multiplication operator, missing or unbalanced delimiters, or other syntax error. To construct matrices, use brackets instead of parentheses.
Add % before ... if you mean to add comment. "..." is used to continue another line, but your next line is new assignment.

6 years ago | 1

| accepted

Answered
Why is cyclomatic Complexity of Switch Block 2?
A Switch block is an equivilant of an if-else statement. Its cyclomatic complexity number is 2.

6 years ago | 1

| accepted

Answered
Increment and decrement counter
Use a 'Unit Delay' block. That is the counter. Add a number to it. The number is either 1 or -1. Use S-R Flip-Flop block to ge...

6 years ago | 0

Answered
finding elements in a vector from another vector
[~,y]=ismember(x,m)

6 years ago | 0

Answered
How to plot points and circles in the same image?
%% c=[0,0;-3 0;2 0]; r=[5;2;3]; viscircles(c,r); hold on; plot(10*rand(20,1)-5,10*rand(20,1)-5,'x');

6 years ago | 1

| accepted

Answered
changing mean and median
M=100; data=(1:M).'; MeanData=data; MedianData=data; for k=1:M MeanData(k)=mean(data(1:k)); MedianData(k)=median(data(1:...

6 years ago | 0

| accepted

Answered
Cannot get mod to return correct value
3^233 is an integer. Its value is roughly 1.5e111. So it needs 112 digits to record the integer value accurately. Double-precisi...

6 years ago | 0

| accepted

Answered
I have problems with "To Workspace"
'out' is just the name of the structure that includes all the variables in all the "To Workspace" blocks. Your variable is in ou...

6 years ago | 0

| accepted

Answered
Pre-Allocate structure with String / Datetime fields slows code down considerably
You are not using struct array. You are putting newdate (which is a datetime array) and full (which is a string array) into a st...

6 years ago | 1

| accepted

Answered
Simulink slower to compile when 'SrcWorkspace' set to 'current' (call to sim a function)
Do you have an apple-to-apple fair comparison? Might it be that when you specify 'SrcWorkspace' as 'current' in runTest(), the d...

6 years ago | 0

| accepted

Answered
How to hold True value infinite
Connect this signal to the "S" (set) of a S-R Flip-Flop block.

6 years ago | 0

Answered
Sample Time Mismatch with S-Function of Same Sample Time?
When you create the S-function for that subsystem, check the input boundary signals and their sample time settings. Try use Inhe...

6 years ago | 0

Answered
Scripts works as main code but not as a function
call it this way [lamdaWC,lamdaWD,lamdaWF,lamdaWG] = noflow_boundary(lamdaO,Imax,Jmax);

6 years ago | 0

| accepted

Answered
Using the enter key to input multiple values for one variable
outAccel=zeros(4,1) for k=1:4 outAccel(k)=input('What are your accel value/'); end

6 years ago | 0

| accepted

Answered
Insert gain as vector
Use a "From Workspace" block to import the gain value as a dynamic signal, specify the data =[1 0.1; 2 0.2; 3 0.3] and then you ...

6 years ago | 0

| accepted

Answered
Splitting Up Large Matrix into n rows x 2 columns
n=100; a=rand(100,4); x=a(:,1:2) y=a(:,3:4)

6 years ago | 1

Answered
Is it possible to read from file in an enabled subsytem?
Rather than trying to figure this out, why don't you just read it from file, use the enable signal or trig signal to switch betw...

6 years ago | 0

Load more