Answered
create zeroes of of row and colum of a huge matrix
zeros(n) creates a nxn all zero matrix zeros(m,n) creates a mxn all zero matrix

10 years ago | 0

Answered
How do I add column headers to a spreadsheet in MATLAB after converting .mat file to .xlsx file?
Use table object would be better for this. help table

10 years ago | 0

Answered
Removing Hidden Files on Windows
"path" is a MATLAB command/keyword. Try not to use it as variable name. dir('*.xlsx') won't return "." and ".." so you don't ...

10 years ago | 0

Answered
copy m file from matlab path to current working directory.
a=which('myfunc.m'); copyfile(a,'myfunc.m');

10 years ago | 1

| accepted

Answered
Multidimensional array indexing question
x=rand(6,2,4); MeanX=mean(x,2); idx=x(:,1,:) < x(:,2,:); x(idx)=MeanX(idx);

10 years ago | 1

Answered
what exactly this Logical indexing refering to?
Please look at the "Using Logicals in Array Indexing" part of this "Matrix Indexing" web(fullfile(docroot, 'matlab/math/matri...

10 years ago | 0

Answered
How to remove sets of values from a column vector using two column vectors with the starting and stopping indeces for removal by row
This method uses string. Not sure if it is more efficient. num=[x_start,x_stop]'; str=sprintf('%d:%d,',num(:)); x(str...

10 years ago | 0

| accepted

Answered
How do I write to a variable multiple times in the same time step in simulink?
This is a good case for using the Merge block. Connect all three outputs to a Merge block and then connect to a single "Data Sto...

10 years ago | 1

| accepted

Answered
Using a Library linked Subsystem twice in a model with different Parameter-Settings
You need to make that library-Subsystem a masked subsystem. Bring that parameter for the Constant block to the mask interface as...

10 years ago | 0

| accepted

Answered
When working with 2 library models, is there a way to script the location of a library block to move it from one library to the other in a model?
Look at the "ReferenceBlock" property of the block. It is the full path to the block in the library model file, following "Libra...

10 years ago | 0

| accepted

Answered
When dealing with the data type "ufix16_Sp1" what does the Sp1 mean?
web(fullfile(docroot, 'fixedpoint/ug/fixed-point-numbers.html'))

10 years ago | 1

| accepted

Answered
How to create counter in simulink instead of using block in library
One way to find out is to drag that Counter library block to your model and then right click, select "Mask", "Look Under Mask"

10 years ago | 0

Answered
Finding NaNs in cell array.
Data_text={'Speed' 'Load' [NaN] 'Sample'}; index=cellfun(@isnan,Data_text,'uni',false); index=cellfun(@any,inde...

10 years ago | 1

Answered
How to copy or transfer a portion of matrix to another at same location?
index=A~=0; C=B; C(index)=A(index);

10 years ago | 1

| accepted

Answered
How to modelling the powertrain of HEV with SimScape
Modeling HEVs Using Simscape http://www.mathworks.com/videos/modeling-hevs-using-simscape-89115.html

10 years ago | 1

| accepted

Answered
How do I display the code line number?
I suggest using the warning('msg'). It will tell you the code line number in the Command Window when it happens.

10 years ago | 1

| accepted

Answered
if i have matrix i want to convert it to vector?
transpose(reshape(b,3,[]))

10 years ago | 0

| accepted

Answered
How to copy an array with some left-over indicies also added on?
n=3; b=cat(1,repmat(a,n,1),a(1:n))

10 years ago | 0

Answered
Combining matrices, adding two matrices in into a bigger one.
Kg(3:6,3:6)=Kg(3:6,3:6)+Ke2

10 years ago | 0

| accepted

Answered
How to only allow certain character/numeric response after prompt; cancel all script if conditions not met?
Use questdlg() for the user to select input. Make your script a function and use return() to exist the function. functio...

10 years ago | 0

Answered
How to add rows to a mtrix following a certain condition?
r= [0; 1; 1.5; 1.6; 2; 10.4; 15.5]; rf=unique(floor(r)); r_out=bsxfun(@plus,rf.',(0:0.1:1).'); r_out=r_out(:); ...

10 years ago | 0

Answered
Getting warning: Could not start Excel server for export. XLSWRITE will attempt to write file in CSV format.
Sometimes it may be overlooked, but can you check if you can open an Excel file in Excel by double clicking that file? I had thi...

10 years ago | 0

Answered
Matlab Simulink Bit Extraction
Remove the "Integer to Bit Converter" block.

10 years ago | 0

Answered
Matrix syntax error question
index=A>B; A(index)=B(index);

10 years ago | 0

| accepted

Answered
Concatenate a 10x4x40 Double Matrix to 40x4
reshape(A(1,:,:),40,[])

10 years ago | 0

Answered
Extracting fields from structures with varying names.
Use this example to see if it helps to resolve your issue clear; data_23_200_600_451=struct('strings',{{'hello','yes'}},...

10 years ago | 0

| accepted

Answered
converting categorical array to cell array
a=nominal({'R_','G_','B_'}); b=cellstr(a); c=strrep(b,'_','-'); d=nominal(c) d = R- G- B-

10 years ago | 5

| accepted

Answered
Running .exe with system()
Try this: 1. Put this line into a text file called input.txt -p -d2 --noLP -P dna_mathews.par --noconv < sequence1.fa > ...

10 years ago | 0

Answered
Remove all remaining charaters once the first non digit occurs within a vector of an array and keep everything before the non digit
a={'22702270|1|60'; '2270|1|60'; '227022702270|1|60'}; b=regexprep(a,'\|.+','') b = '22702270' ...

10 years ago | 0

| accepted

Answered
How can I speed up fread(), fwrite() ?
Theoretically, it takes 4 seconds to send 57600 bytes at 115200 bit rate. 57600*8/115200 =4

10 years ago | 0

| accepted

Load more