Answered
How to save multiple Matlab figures in separate folders?
use fullfile() to specify the full path of the file and saveas().

8 years ago | 0

Answered
Exporting Simulink models as SVG in MATLAB R2016b and beyond?
use print() with '-dsvg' f14; handle=get_param('f14','handle'); print(handle,'-dsvg','MyModel'); winopen MyModel.s...

8 years ago | 4

Answered
Function executing a Script - Intrested in Scripts Output
See Jan's comments above, but for your problem, use this: evalin('base','Script1')

8 years ago | 1

| accepted

Answered
Getting message while converting following matlab code to c? This structure does not have a field 'numResources'; new fields cannot be added when structure has been read or used.
You are creating the structure p, adding its fields on-the-go. For example, fields "numTx", "numRx" and "numLayers" etc. are cre...

8 years ago | 0

| accepted

Answered
Why Matlab 2017a needs twice more time than 2014a to run the same code?
I would suggest you contacting Mathworks' technical support for this. If you could provide your example data, I am sure they wil...

8 years ago | 0

| accepted

Answered
how to validate edittext to accept only integers between 25 to 100
if num<=25 && num>=100 should be if num<=25 || num>=100

8 years ago | 0

| accepted

Answered
'Undefined function or variable ' error but variable is defined in function working in GUI
if nargin < 2 h=3; % local search window size: h=3; h=5; h=7; h=9; h=11; f=1; % padding value for window: ...

8 years ago | 0

| accepted

Answered
Saving strings (ex. 0222222) from MATLAB to Excel using xlswrite is saving as a numeric.
Add a single quote in front to deal with Excel a={'"022','''022','022'} xlswrite('test.xls',a); winopen test.xls

8 years ago | 0

Answered
How can I display a matrix with 6 decimal places accuracy?
See "help format" to see if you can find the right format format long disp(single(rand(3)))

8 years ago | 3

| accepted

Answered
How to remove all rows from categorical variable corresponding to a double array?
index=and(A(:,1) > 0,B(:,1) > 0) X1=X(index,:)

8 years ago | 0

| accepted

Answered
Select nearest value on a vector for a given value
Can you use built-in function? X=10:10:100; Y=1:10; out=interp1(X,Y,12,'nearest') out=interp1(X,Y,18,'nearest')

8 years ago | 0

Answered
Compare segments of a vector
What if none of the element in second 5 elements is greater than the first 5 elements? The code below might be easier to underst...

8 years ago | 0

| accepted

Answered
Search string and get its position in excel using Actxserver
I will just read the Excel file anyway and search the Raw data. [Num,Txt,Raw]=xlsread(fullname,sheet); Or, if 'cotton' i...

8 years ago | 0

Answered
Compare segments of a vector
This example should give you an idea A=transpose(reshape(rand(20,1),5,[])) B=diff(A) C=B>0 C should tell you the r...

8 years ago | 0

Answered
How to access all subdirectorie?
Use dir(fullfile('M:\F1','**/*.*')). It will list everything in the folder and all sub-folders.

8 years ago | 1

| accepted

Answered
Hello Everyone, I'm looking for your help for the following problem
I'll provide a lead. I think the rest should be relatively easy. A = [17 14 18 15 14 19;... 1 5 3 30 8 14;... ...

8 years ago | 0

Answered
Is there any one who can help for the following matrix problem
I think this is the way to do it. Your expected output has typo in it. M=[15 18 14 19 17 14; 30 3 8 14 1 5;...

8 years ago | 1

| accepted

Answered
Simulink - Pass mask name to blocks under mask
try this in your display command str=get_param(gcb,'nam'); disp(['Potentiometer Sensor Characteristics\n' str]);

8 years ago | 1

Answered
How to replace the values of a Matrix
Is this what you want? A=rand(3,10); B=rand(3,10); C=A+B; D=2.*C; for k=1:5 A=D; C=A+B; D=2.*C; ...

8 years ago | 0

Answered
Add a large number of comma separated numbers to a txt file
%d can be used repeatedly automatically, run this to see the effect: fprintf(1,'\n%s ',"favorite numbers"); fpri...

8 years ago | 0

| accepted

Answered
m script bus selector output
'GWM_FR_BCM_A_BUS' should be an immediate element of the input bus, not the input bus itself, right? In any case, I would sug...

8 years ago | 0

| accepted

Answered
Finding duplicate variables in multiple M files
Run each M-file and save a .mat file afterwards (don't forget to run "clear" first each time) VarList1=fieldnames(load('MFile...

8 years ago | 0

| accepted

Answered
Refresh Mask after saving Model
You can specify a function, or lines of code in the Model Properties -> Callbacks -> PostSaveFcn. I wonder if you can do a mo...

8 years ago | 0

| accepted

Answered
How to remove the display of ans on a function
TriangleA(10); Add the semicolon ; at the end

8 years ago | 1

| accepted

Answered
How can I save a file with the same name as the foldername?
save (all_names(nn).name,'variable') all_names(nn).name is already a string. Your usage of it in cd() is correct

8 years ago | 0

| accepted

Answered
How to copy contents from one Subsystem into a sub subsystem within another model?
Should work as long as 'Scheduler/Scheduler' exists already. In fact I just verified.

8 years ago | 0

| accepted

Answered
How can I send variable from workspace to simulink?
If you have the variable 'a' in base workspace, double click the Constant block, put in 'a' (without the quote) under "Constant ...

8 years ago | 0

Answered
What is wrong with my code? How can i set parameters from an array into a block in simulink?
Most block parameters, even though they are numeric to the user, are strings when getting from get_param(). So when setting the ...

8 years ago | 2

Answered
Determine if a day is a bank holiday (from a matrix)
t1 = datetime(2014,1:5,1) t2 = datetime(2014,1,1) ismember(t2,t1)

8 years ago | 1

Load more