Answered
Help doing the average between successive (1,2) cells of two different arrays?
a=rand(250,2) a1=a(1:2:end,:); a2=a(2:2:end,:); b=(a2+a1)/2

12 years ago | 0

Answered
Plotting a Scatter Plot With Logarithmic Axes
scatter(1:10,1:10) set(gca,'xscale','log')

12 years ago | 14

| accepted

Answered
Create a matrix of binary numbers generated by sequence
n=3; s=0:1; idx=rem(nchoosek(0:2^n-1,n),2)+1; out=flipud(unique(s(idx),'rows'))

12 years ago | 0

Answered
How do I convert a hexadecimal input from the user into binary form?
Example h='555F' d = hex2dec(h) b = dec2bin(d) Now, what do you mean: I have trouble with this

12 years ago | 0

Answered
How to use find() to find unique values in equations?
Example x=10; y=20 z1 = x + y z2 = 2x + y idx=z1==z2 % if idx is equal to 0, that means z1 and z2 are different

12 years ago | 0

Answered
functions handle for a summation over n elements
f=@(x) sum(diff(x).^2)

12 years ago | 0

| accepted

Answered
How to plot a 2D histogram of pixel pairs ?
This looks like the <http://www.mathworks.com/matlabcentral/answers/123691-how-do-i-know-the-frequency-of-each-unique-pair previ...

12 years ago | 0

Answered
Error in port widths or dimensions. Output port 1 is a one dimensional vector with 13 elements.
The output of your MUX block is a vector of 13 elements, those 13 elements are used somewhere in your model. Check if the dimens...

12 years ago | 0

| accepted

Answered
what's the difirent between simulation in simulink with simulation in system generator????
If you mean Simulink Report generator, this allows to generate documentation for Simulink and Stateflow models.

12 years ago | 0

Answered
Is it normal for a code with 2 nested for loops to run for more than 2 hours ?
That depends on the number of iterations and the task done each iteration. You didn't give enough details

12 years ago | 0

| accepted

Answered
what's the difference between f and f(x) in matlab?
To know the difference type whos f d=f(x) whos d

12 years ago | 1

| accepted

Answered
Is there command to go line I want?."goto"
There is no such command in Matlab, plus, it's not recommended to use goto. It's hard to read a big code with many goto inside. ...

12 years ago | 1

| accepted

Answered
code for summation(i= 1 to m) sum(j=1 to n) R(i,j).
v1=sum(R(:))

12 years ago | 0

| accepted

Answered
How do I know the frequency of each unique pair?
A=uint8([1 2;3 4;1 2;5 6;1 2;5 6]) [ii,jj,kk]=unique(A,'rows') f=histc(kk,1:numel(jj)) %frequencies out=[ii f] ; % the firs...

12 years ago | 0

Answered
How to create an array from a while loop
clc clear time=(0:0.5:6); b=1.5; bact=zeros(1,12); n=1; while n<13 b=b*2; bact(n)=b; n=(n)+1; fprint...

12 years ago | 2

| accepted

Answered
how to count repeated character in string ??
str='aaaaddccccfeeee' [ii,jj,kk]=unique(str) freq=histc(kk,1:numel(ii)) c=regexp(ii,'.','match')' out=[c num2cell(freq)] ...

12 years ago | 3

| accepted

Answered
How can i build the state space for a linear time varying system in MATLAB?
You can use (derivative, sum, prod, gain) blocks to build your model

12 years ago | 0

Answered
Sort in ascending order for first column then descending order for the second column.
A=[1 1 1; 3 2 1; 1 3 1] B=sortrows(A,[1 -2])

12 years ago | 3

| accepted

Answered
how to count number of values present in some defined intervals?
a=[0.1, 0.2,1,1.9,2.1,2.5,3,4.1,5,5.2,6,8,9.1,9.9] id=[0 2 4 6 8 10] freq=histc(a,id)

12 years ago | 0

| accepted

Answered
How can I have different marker sizes for different points in 1 line plot
x=1:4 y=[10 20 30 40] plot(x,y) A=[2 4 6 8] %sizes hold on for k=1:numel(A) h=scatter(x(k),y(k),'marker','o','linewi...

12 years ago | 0

| accepted

Answered
Count unique values in an array
If M is your cell array Try this, c3=M(:,3) [ii,jj,kk]=unique(c3) f=histc(kk,1:numel(jj)); % Frequencies corresponding t...

12 years ago | 2

| accepted

Answered
finding the frequency of each row (2)
B=[-1 -1 -1 0 -1 1 0 -1 0 1 1 -1 1 0 1 1] A==[1 1; 0 1;...

12 years ago | 0

| accepted

Answered
How to find the frequency of each row with certain coordiante in a matrix?
A=[1 1; 0 1; 1 0; -1 1;-1 1;0 1;0 1] [ii,jj,kk]=unique(A,'rows','stable') f=histc(kk,1:numel(jj)); % Frequency result=[ii f...

12 years ago | 2

| accepted

Answered
How to divide different rows of a matrix to different numbers?
Maybe you want A=[4 4; 0 3; 2 0; -5 5] out=sign(A)

12 years ago | 0

| accepted

Answered
extract matrix from matrix
*Edit* A=rand(256) % Example idx=1:8:256 [jj,ii]=meshgrid(idx,idx) B=cell2mat(arrayfun(@(ii,jj) A(ii:ii+3,jj:jj+3),ii,j...

12 years ago | 1

Answered
How to set path of user defined function in matlab2013b?
Put your file in a current folder %or use addpath addpath('your_folder')

12 years ago | 1

Answered
print a cell array as .txt in Matlab (2)
M=cell2mat(A'); dlmwrite('file.txt',M)

12 years ago | 0

| accepted

Answered
How to use expint in Matlab for two argument?
Try double(expint(4,sym(3)))

12 years ago | 0

Load more