Answered
How do you split up a matrix into 2 matrices where the rows are made up of the rows from the initial matrix containing certain numbers?
Contain77InRow=any(J==77,2); A=J(Contain77InRow,:) B=J(~Contain77InRow,:)

8 years ago | 2

| accepted

Answered
Why is exist(variable,'var') not seeing a variable?
exist('signedOrNot','var')

8 years ago | 3

| accepted

Answered
MATLAB version 2018b provides a different exception identifier for the same situation than version 2017b did. Can you suggest the easiest way to handle this that works for both versions?
You didn't identify other errors. Is it necessary to identify this error, or you just simply need to catch an errors. Anyway,...

8 years ago | 0

| accepted

Answered
How to compare a number with values of a vector?
A = [20 40 60 80 100 120]; x=30; lowB=interp1(A,A,x,'previous') HighB=interp1(A,A,x,'next')

8 years ago | 0

| accepted

Answered
How to combine structures with the same name fields?
Did you try New=[xswn; xsw_]

8 years ago | 0

| accepted

Answered
How to change storage class
use get() and set(), instead of get_param() and set_param()

8 years ago | 0

Answered
How many times each element of an array have the 1 value after n times assigned different logical values?
Constructing your data as 3d matrix will make it easy. %% A(1,:,:) =[ 1 0 0 1 0 1 0 0 1 0 1 0 0 0 0 1 1 ...

8 years ago | 0

Answered
Reusing Signal Builder Generator in another Simulink model
Viewers and generators are not blocks. One way to resolve this: 1. "Select All" and delete all the blocks in your current mod...

8 years ago | 0

| accepted

Answered
Simulink mask display programmatically, how to make line shift?
use char(10), set_param( gcbh,'MaskDisplay', ['port_label(''input'', 1, ''in1'');',char(10),'port_label(''output'', 1, ''ou...

8 years ago | 0

| accepted

Answered
How can I list file-paths from different subfolders?
You can use f=dir('C:/directory01/person*/subdirectory02/file01.x')

8 years ago | 0

| accepted

Answered
S-function does not exist error!
run "mex -setup" to select VC2017 as the compiler and then run mex.

8 years ago | 0

Answered
How to use DIR to extract file data (name, date, location/address/transit) from multiple folders and subfolders?
x=dir(fullfile(MyFolder,'**/*.*')) will give you all the files and folders in MyFolder and all its subfolders.

8 years ago | 2

| accepted

Answered
Where do I find files for simulink tutorials?
That web page is for R2018b document. What are you looking for? For Simulink tutorial in your version, type web(fullfile(doc...

8 years ago | 0

| accepted

Answered
Saving struct to an Excel file
You can take a look at the example in the document. Use rmfield() to remove the first three fields. Since all the other fields a...

8 years ago | 0

| accepted

Answered
Select xlim max-value
max() is a function. Don't use it as a variable name. xmax=max(xlim)

8 years ago | 1

| accepted

Answered
How to write a simple MATLAB code for simplification of if.. else.. code
Now I think your problem has nothing to do with the increasing or decreasing of the values in x. Rather, it is to lookup and "ma...

8 years ago | 0

Answered
Matlab command window result in one line , even wrap text views the output in an non organized way.
use '\n' in fprintf() fprintf('a1\nb2\nc3\n')

8 years ago | 0

Answered
Can we find simulink signal object used in the model using Simulink.findVars?
Yes. Make a simple example and you can find it out. Updated in March 2024 using MATLAB R2022b. Make a simple Simulink model, f...

8 years ago | 0

Answered
How do I determine the names and idicies of worksheets in an Excel file using ActiveX?
I suggest N_Sheets=ewb.Sheets.Count; for k=1:N_Sheets ewb.Sheets.Item(k).Name end

8 years ago | 1

| accepted

Answered
How to write a simple MATLAB code for simplification of if.. else.. code
x=10:10:100; xp=29; n=numel(x); interp1([-realmax,x,realmax],[1,1:n,n],xp,'previous')

8 years ago | 0

Answered
How to comment on a simulink subsystem as shown in the figure?
That is not really a "comment". Most likely, it is a mask display. If you select the block, right click, select "Mask" then "Edi...

8 years ago | 0

| accepted

Answered
How do I add superscript numbers to a CSV-File with fprintf?
CSV file can not contain format so you can't achieve superscript in CSV file.

8 years ago | 0

Answered
Any documents for Autosar embedded coder with simulink
<https://www.mathworks.com/help/supportpkg/autosarstandard/index.html Embedded Coder Support Package for AUTOSAR Standard>

8 years ago | 0

Answered
How to enable content preview for all subsystems programmatically?
Please refer to this example. f14; SubSystems=find_system('f14','FindAll','On','BlockType','SubSystem'); set(SubSyste...

8 years ago | 2

| accepted

Answered
S- Function cannot found
It sounds like the S-function .mexw64 file is created in later version (for example, R2015b) of MATLAB and is not compatible wit...

8 years ago | 0

| accepted

Answered
function outputs as input control variant in simulink
It sounds like "variant subsystem" should not be used. Instead, "conditionally executed subsystem" should be used. In this case,...

8 years ago | 1

| accepted

Answered
How to change the parameter value of multiple (same) modules in Simulink?
Usually, write a script to do it in a batch, using the following functions. find_system() get_param() set_param()

8 years ago | 0

Answered
How to select the indices of two arrays that satisfy two conditions using cellfun (no loops or ifs)?
IndA=contains(A,'(1)'); IndB=cellfun(@(x) sum(x)==1, isstrprop(B,'upper')); Index=find(and(IndA,IndB))

8 years ago | 0

| accepted

Answered
Loop to carry out calculation for pairs 1 and 2, then pairs 2 and 3 and so on.
You have 8 locations thus 7 distances. When j is 8, Final_Latitude_Values(j+1) exceeds the matrix dimension. Change the for-l...

8 years ago | 0

Answered
Issue in executing command containing single quote using Plink
I would suggest putting all the commands in a M-script and then run "fullpath\bin\matlab.exe" -r "MyScript" Notice the dou...

8 years ago | 0

Load more