Answered
Amusing HG1 plotting bug
With Matlab R2016a <</matlabcentral/answers/uploaded_files/50040/c1.jpg>>

10 years ago | 1

Answered
Appending variables from different mat files
a=dir('*.mat') b={a.name} v=[]; for k=1:numel(b) load(b{k}) v=[v;abc] end

10 years ago | 0

| accepted

Answered
How can display overlaying lines as darker? Using for lines for density plot
Look at Matt's answer <http://www.mathworks.com/matlabcentral/answers/6056#answer_8420>

10 years ago | 0

| accepted

Answered
how to put a list numbers from the user into a matrix in matlab
s=inputdlg('enter your matrix like this [1 2;4 6]'); out=str2num(s{:})

10 years ago | 0

Answered
error. how to fix?
Have you downloaded the function from <http://www.mathworks.com/matlabcentral/fileexchange/34767-a-suite-of-minimal-bounding-obj...

10 years ago | 0

| accepted

Answered
fprintf in Gui text box
Use sprintf instead of fprintf set(handles.edit1,'string', sprintf(your_string))

10 years ago | 0

Answered
Create 'double' array with varying element sizes
You can use cell arrays, A=[1 2 3] B{1}=A A=[4 5 6 7] B{2}=A

10 years ago | 0

| accepted

Answered
Adding valies from a table into a zero matrix
M=[8 26 240; 39 6 52; 600 530 211] idx=ismember(M(:,1:2),[8,26],'rows') out=M(idx,3)

10 years ago | 0

Answered
ind2sub output in arrayform
A=randi(5,5,4,3) id=[1 12 25 45]' idx=cell(ndims(A),1) [idx{:}]=ind2sub(size(A),id) celldisp(idx)

10 years ago | 0

| accepted

Answered
How do import data?
[a,~,~,~]=textread('file.txt')

10 years ago | 0

| accepted

Answered
How to generate a sequence of words?
You can improve your code Letters = ['a':'z' '_'] LetterPositions =randi(27,1,27) RandomLetters = Letters(LetterPositions...

10 years ago | 1

| accepted

Answered
How to find all first records of specified item between each specified case in the table
*Edit* v={'Calibration' 'HT0MEK' 'End' 'HT0MEK' 'Calibration' 'JT0KEL'...

10 years ago | 0

| accepted

Answered
how to perform the double summation for this equation?
n=3 m=4 M=randi([0 1],n,m) A=rand(n,m) [ii,jj]=meshgrid(1:n,1:m) out=sum(abs(A(ii(:))-abs(M(jj(:)))))

10 years ago | 0

Answered
if i have a matrix and i want check condition if true then copy this row or column to new matrix?
A = [ 1 1 1 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 1 1 1 1 0 0 0 0 0 1 1 ...

10 years ago | 0

Answered
Using arrayfun on the indices of a cell array to calculate all cells in one call?
It's better to use a for loop

10 years ago | 0

Answered
Create n matrix from one matrix according to elements of a column?
A = [ 4 2 0 ;3 7 0 ; 8 9 3 ; 7 5 3; 4 4 3] [ii,jj,kk]=unique(A(:,3)) out=accumarray(kk,1,[],@(x) {A(x,:)}) % the first m...

10 years ago | 1

Answered
fprintf: display for-loop index/start a new line
for i = 1:5 fprintf('Current number is %d\n',i); end

10 years ago | 1

| accepted

Answered
can i convert my image from bw2rgb
<http://www.mathworks.com/matlabcentral/fileexchange/24747-image-format-conversion--binary-to-rgb/content/bw2rgb.m>

10 years ago | 0

| accepted

Answered
Sorted vector changing dimensions
instead of a=a' use a=reshape(a,size(a'))'

10 years ago | 0

Answered
Creating a GUI?
Specify the axes where you want to plot plot(handles.axes1,t,y)

10 years ago | 0

Answered
In Matlab, how do I count the number of times an element consecutively repeats in a matrix?
You can use a for loop, for k=1:size(A,1) % do your code out{k}=your_result end

10 years ago | 0

Answered
Matrix sorting, smallest to biggest
reshape(sort(A(:)),fliplr(size(A)))'

10 years ago | 0

Answered
How to filter a matrix?
A=randi(80,4,20) n=size(A,1) max1=zeros(n,10); indices=zeros(n,10); for k=1:size(A,1) [ii,jj]=sort(A(k,:),'descend');...

10 years ago | 0

Answered
multiplication of cell consist with matrix?..
bsxfun(@times,A{1},B{2})

10 years ago | 0

Answered
Is there a way to run fmincon from a MATLAB function block in Simulink?
You can call it from Matlab function block

10 years ago | 0

Answered
How to download a model example
It's written in the third line of the help open_system('rtwdemo_secondOrderSystem')

10 years ago | 0

| accepted

Answered
find in structure a certain string
C={'serial';'123456 1-2-3';'1452145 4-5-6';'745841 3-2-4';'85471245 1-2-3'} C=C(2:end); idx=~cellfun(@isempty,regexp(C,'1-2-...

10 years ago | 0

| accepted

Answered
Logical indexing two dimensions. How do I avoid a nested for loop?
You can improve your for loop by pre-allocating A=zeros(400,400,9,64)

10 years ago | 1

Answered
How to load a .dat (comma-separated)
v=importdata('1.dat') w=v(1:2:end) out=regexprep(w,'(?<=\S+,\S+),', ' ')

10 years ago | 0

| accepted

Load more