Answered
How can I change the color and font on the second y axis of a subplot?
Try this close x=0:0.1:10; y=sin(x) z=cos(x) subplot(4,2,2); [ax,h1,h2]=plotyy(x,y,x,z); hl=legend('y','z','Location'...

12 years ago | 0

| accepted

Answered
How to apply to each sub-set of a vector a different formula?
A=rand(1,1000) % example B=reshape(A,100,10) Then apply your formula to each column of B Or use a cell array B=nu...

12 years ago | 0

Answered
How do you output a signal that changes with time to a constant value in Simulink?
You can use a product block

12 years ago | 0

| accepted

Answered
cell output of function
D=cell2mat(fDurations(I));

12 years ago | 0

| accepted

Answered
how to make an array to a matrix??
reshape(A,125,80)

12 years ago | 0

| accepted

Answered
Changing the period of sine wave function in Simulink?
<</matlabcentral/answers/uploaded_files/11593/sinus.jpg>>

12 years ago | 0

| accepted

Answered
How to get a 3d scatter plot from an nx3 matrix
scatter3(A(:,1),A(:,2),A(:,3))

12 years ago | 0

| accepted

Answered
How to rearrange an array ? (only unique numbers in a column)
A = [1 1;1 4;2 3;2 7;3 5;4 2;5 6] , c=accumarray(A(:,1),A(:,2),[],@(x) {x}) n=max(cellfun(@numel,c)); B=[unique(A(:,1),'sta...

12 years ago | 0

| accepted

Answered
Advanced use of randi(x) and other random number generating functions
your_range=[1:5 7:9] [~,ii]=sort(rand(1,numel(your_range))) out=your_range(ii)

12 years ago | 0

Answered
How do I count the number of zeros in a matrix?
A=[0 0 1;0 2 4;7 8 1] idx=A==0 out=sum(idx(:)) or out=nnz(~A)

12 years ago | 19

| accepted

Answered
How to combine multiple columns into a single column?
A=[ 1 2 3 4 5 6 7 8 9 1 2 3] out=A(:) or out=reshape(A,[],1)

12 years ago | 9

| accepted

Answered
converting from radian to degree
That depends on what you want to convert to degrees plot(x,y*180/pi) or plot(x*180/pi,y)

12 years ago | 1

| accepted

Answered
Operands to the || and && operators must be convertible to logical scalar values. What is the error?
Use while norm>0.01 & it<100 norm is a vector, what norm>0.01 means?

12 years ago | 1

Answered
convert variable to global
global handles

12 years ago | 0

| accepted

Answered
Readall files with different size,format , and extension in a directory
folder='C:\Program Files\MATLAB71\work\subfolder\files location' fnames = [dir([folder '\*.dat']);dir([folder '\*.txt'])];

12 years ago | 0

Answered
How to import coordinates from a txt/csv file
A=dlmread('Yourfile.txt') Or A=xlsread('Yourfile.csv')

12 years ago | 0

Answered
Passing in a function as an argument
a=@subFunc2 Then call your function with a argument

12 years ago | 0

Answered
What does ~ mean in the case of an if statement?
It means not(your expression') Exemple a=[1 0] ~a or not(a)

12 years ago | 0

Answered
generate delta delayed vector
a=[1 0 0] N=2; b=circshift(a,[0 N])

12 years ago | 0

Answered
how to create .mat file with three variables x y z and each variable has 1500 data?
save data x y z Look at doc save doc load

12 years ago | 0

| accepted

Answered
replace number for specific column in string using (strrep & if)
A=[1,2,3,4,5,6,5;4,5,6,8,5,8,6] c7=A(:,7) c7(ismember(c7,5))=1 c7(ismember(c7,6))=2 A(:,7)=c7

12 years ago | 0

Answered
Set initial value in Matlab Function block
You can use persistent declaration function UP=fcn(UPI) persistent UPI1 if isempty(UPI1) UP=UPI else UP=UPI1 en...

12 years ago | 1

Answered
easiest way to get structure to excel
From your struct variable, you can create one 42x4 array A, then use xlswrite to export your data to an Excell file xlswrit...

12 years ago | 0

Answered
Create cell array from matrix indices
A=[2.25 1;1.85 1;2.5 2;1.9 2;2.14 2;3.5 3;1.79 3;2.89 4] C=accumarray(A(:,2),A(:,1),[],@(x) {x}) celldisp(C)

12 years ago | 0

Answered
How to group string datasets?
*Edit* ratings={123456 [] [] 'A+' 234567 [] [] 'A' 234567 [] [] 'A' 345678 [] 'Aa2'...

12 years ago | 0

| accepted

Answered
How do I read a large list of X,Y co-ordinates from Notepad and plot a graph in Matlab ?
data=dlmread('yourfile.txt'); x=data(:,1); y=data(:,2); plot(x,y)

12 years ago | 1

Answered
how can i find the sum of matrix elements
You can use sum function sum(A(:))

12 years ago | 2

Answered
About "Matlab Fctn" block
That's because the output of your Matlab Function block is the result of your for loop. The output is not the result of each ite...

12 years ago | 0

| accepted

Answered
Split string in cells to two cells
str={'ABC DEF';'GHI JKL';'MNO PQR' } out=cellfun(@strsplit,str,'un',0) out=reshape([out{:}],2,[])'

12 years ago | 0

Load more