1967 total contributions since 2006

What is a model?

Professional Interests: Model-Based Development

Answered

What command could run any file.m chosen

help run FileName='c:\mydoc\test.m'; run(FileName);

What command could run any file.m chosen

help run FileName='c:\mydoc\test.m'; run(FileName);

9 days ago | 0

Answered

How can I change the configuration parameters by command line?

On the configuration parameter dialog window, hover over "Type" under "Solver options", right click, select "What's this?", it w...

How can I change the configuration parameters by command line?

On the configuration parameter dialog window, hover over "Type" under "Solver options", right click, select "What's this?", it w...

9 days ago | 0

| accepted

Answered

PostLoadFcn attempts to run before block diagram is fully loaded

From the error message, "Name changes are allowed only after the block diagram is loaded fully", it sounds like the name changin...

PostLoadFcn attempts to run before block diagram is fully loaded

From the error message, "Name changes are allowed only after the block diagram is loaded fully", it sounds like the name changin...

1 month ago | 0

Answered

count number values exceeds given threshold in moving window

M=100; N=4; A=randi(35,1,M); B=A>20; C=ones(N,M-N); C(1,:)=1:(M-N); C=cumsum(C); D=sum(B(C));

count number values exceeds given threshold in moving window

M=100; N=4; A=randi(35,1,M); B=A>20; C=ones(N,M-N); C(1,:)=1:(M-N); C=cumsum(C); D=sum(B(C));

1 month ago | 0

Answered

How to call specific numbers from a matrix?

a=rand(100,3) A=sum(a(:,1)>0.5) B=sum(a(:,2)>0.3 & a(:,3)>0.2)

How to call specific numbers from a matrix?

a=rand(100,3) A=sum(a(:,1)>0.5) B=sum(a(:,2)>0.3 & a(:,3)>0.2)

1 month ago | 0

| accepted

Answered

Writing contents cell into a txt file

c={'dog','cat','fox'}; fid=fopen('out.txt','w+t'); for k=1:10 fprintf(fid,'%s ',c{:}); end fclose(fid);

Writing contents cell into a txt file

c={'dog','cat','fox'}; fid=fopen('out.txt','w+t'); for k=1:10 fprintf(fid,'%s ',c{:}); end fclose(fid);

2 months ago | 0

| accepted

Answered

Checking inequality condition for each component of a vector.

To explain the result you saw, your command is equal to : temp=-0.1 < vec; temp < 0.1

Checking inequality condition for each component of a vector.

To explain the result you saw, your command is equal to : temp=-0.1 < vec; temp < 0.1

2 months ago | 0

Answered

I have a file saved in matlab workspace. I want to find out the FFT of that stored data? How can i do that

There is a MATLAB function called fft(). help fft

I have a file saved in matlab workspace. I want to find out the FFT of that stored data? How can i do that

There is a MATLAB function called fft(). help fft

2 months ago | 0

Answered

how to set 'Fixed-step size' specified in the Configuration Parameters dialog for block diagram in a simulink model from a GUI

You need to set a value for the variable 'Ts' in the base workspace. assignin('base','Ts',0.01)

how to set 'Fixed-step size' specified in the Configuration Parameters dialog for block diagram in a simulink model from a GUI

You need to set a value for the variable 'Ts' in the base workspace. assignin('base','Ts',0.01)

3 months ago | 0

Answered

How can I put index number of matrix itself?

Use cell array, maybe? n=5; A=cell(n,1); A{1}=1; A{2}=rand(2); A{3}=magic(3); ...

How can I put index number of matrix itself?

Use cell array, maybe? n=5; A=cell(n,1); A{1}=1; A{2}=rand(2); A{3}=magic(3); ...

3 months ago | 0

Answered

Diary file with current date and time as time stamp

dfile=[datestr(now,'mm-dd-yyyy'),'-1529.txt']; diary(dfile);

Diary file with current date and time as time stamp

dfile=[datestr(now,'mm-dd-yyyy'),'-1529.txt']; diary(dfile);

3 months ago | 0

Answered

How to string 1 and 0 into array

'1101111000111101'-48 sprintf('%d',[1 1 0 1 1 1 1 0 0 0 1 1 1 1 0 1])

How to string 1 and 0 into array

'1101111000111101'-48 sprintf('%d',[1 1 0 1 1 1 1 0 0 0 1 1 1 1 0 1])

3 months ago | 1

Answered

To Workplace delays data write out when simulation is paused

try set_param('Model','SimulationCommand','WriteDataLogs') or set_param('Model','SimulationCommand','Update') to force it. I...

To Workplace delays data write out when simulation is paused

try set_param('Model','SimulationCommand','WriteDataLogs') or set_param('Model','SimulationCommand','Update') to force it. I...

3 months ago | 0

Answered

How to Find First Min Value And Index it??

[row col]=find(q==minq,1,'first') or q=[5 8 1 4 1 2 2 3 1] [minq,Loc]=min(q(:)); [row col]=ind2sub...

How to Find First Min Value And Index it??

[row col]=find(q==minq,1,'first') or q=[5 8 1 4 1 2 2 3 1] [minq,Loc]=min(q(:)); [row col]=ind2sub...

3 months ago | 0

Answered

How can i shorten the duration this code takes? it takes 0.4 seconds to complete if you insert a longer string. I would prefer not using the for loop but it is still welcome

what about A1=unique(str)?

How can i shorten the duration this code takes? it takes 0.4 seconds to complete if you insert a longer string. I would prefer not using the for loop but it is still welcome

what about A1=unique(str)?

3 months ago | 1

| accepted

Answered

How to save logged signal to a MAT file without using 'TO WORKSPACE' block ?

If it is done through customized GUI, it might depend on the customized GUI. If it is done through right click the signal li...

How to save logged signal to a MAT file without using 'TO WORKSPACE' block ?

If it is done through customized GUI, it might depend on the customized GUI. If it is done through right click the signal li...

3 months ago | 0

| accepted

Answered

Comapre matrix and function a operation

Here is one solution. You might need to clarify some special cases. What the output should be if B contains value 25 or 20? ...

Comapre matrix and function a operation

Here is one solution. You might need to clarify some special cases. What the output should be if B contains value 25 or 20? ...

3 months ago | 0

| accepted

Answered

i would like to compare two matrixes with different dimension, A and B if any of the element in A is matched with B then that element in A has to be set to zero ?

A(ismember(A,B))=0

i would like to compare two matrixes with different dimension, A and B if any of the element in A is matched with B then that element in A has to be set to zero ?

A(ismember(A,B))=0

3 months ago | 0

| accepted

Answered

Pre allocating all fields in a structure?

mystructure=cell2struct({1,'xyz'},{'a','b'},2)

Pre allocating all fields in a structure?

mystructure=cell2struct({1,'xyz'},{'a','b'},2)

3 months ago | 0

Answered

How do I create an array containing the system layout of a Simulink model?

Hierarchy=find_system('ModelName','LookUndermasks','All','FollowLinks','on','BLockType','SubSystem')

How do I create an array containing the system layout of a Simulink model?

Hierarchy=find_system('ModelName','LookUndermasks','All','FollowLinks','on','BLockType','SubSystem')

4 months ago | 0

| accepted

Answered

How to fix: Attempt to execute SCRIPT fprintf as a function:

fprintf() is a built-in function. \toolbox\matlab\iofun\fprintf.m is a help text file. Why do you have your own C:\Users\Holl...

How to fix: Attempt to execute SCRIPT fprintf as a function:

fprintf() is a built-in function. \toolbox\matlab\iofun\fprintf.m is a help text file. Why do you have your own C:\Users\Holl...

4 months ago | 1

Answered

How to create. xml file using stored data in matlab variables ?

help xmlwrite and see the example

How to create. xml file using stored data in matlab variables ?

help xmlwrite and see the example

4 months ago | 0

Answered

Is there a way to turn off or suppress bold headers on tables in the Command Window?

It might not be possible according to the document. http://www.mathworks.com/help/matlab/ref/diary.html?searchHighlight=diary...

Is there a way to turn off or suppress bold headers on tables in the Command Window?

It might not be possible according to the document. http://www.mathworks.com/help/matlab/ref/diary.html?searchHighlight=diary...

4 months ago | 0

Answered

How to set visibility of Button in SIMULINK Mask ?

Select your masked block, type "get(gcbh)" in Command window to see a full list of parameters and their values. get/set eithe...

How to set visibility of Button in SIMULINK Mask ?

Select your masked block, type "get(gcbh)" in Command window to see a full list of parameters and their values. get/set eithe...

4 months ago | 0

Answered

How to programmatically change the name of a S-function

I tried and it seemed working. set_param(BlockPath,'FunctionName','NewS_Function');

How to programmatically change the name of a S-function

I tried and it seemed working. set_param(BlockPath,'FunctionName','NewS_Function');

4 months ago | 0

Answered

how many total variable we can define in Matlab 2015?

Run "namelengthmax" to find it out.

how many total variable we can define in Matlab 2015?

Run "namelengthmax" to find it out.

4 months ago | 1

Answered

How to give randi values in different columns of matrix

just add this? b(:,2)=~b(:,1)

How to give randi values in different columns of matrix

just add this? b(:,2)=~b(:,1)

4 months ago | 0

| accepted

Answered

Custom Library creation issue

The document is for MATLAB R2016a. I tried in MATLAB R2015b. It seems working, no errors. When I tried in MATLAB R2012a. T...

Custom Library creation issue

The document is for MATLAB R2016a. I tried in MATLAB R2015b. It seems working, no errors. When I tried in MATLAB R2012a. T...

4 months ago | 0

Answered

How can i add grid lines on interactive editing on a matlab figure

Double click the Axes, it will bring up the Property Editor for Axes. There are check-marks for Grid on X, Y and Z.

How can i add grid lines on interactive editing on a matlab figure

Double click the Axes, it will bring up the Property Editor for Axes. There are check-marks for Grid on X, Y and Z.

4 months ago | 0

| accepted

Answered

Change "current block"/gcb/gcbh programmatically

The best way to resolve this is to use the actual block path or block handle, instead of gcb/gcbh. You could modify the function...

Change "current block"/gcb/gcbh programmatically

The best way to resolve this is to use the actual block path or block handle, instead of gcb/gcbh. You could modify the function...

4 months ago | 1