Answered
I can't use sigmf
x=0:255; y=sigmf(x,[0.1 127.5]); plot(x, y)

10 years ago | 0

Answered
Separating a vector based on its value
v=randi([0 360],1,1000) threshold=3 out=accumarray((cumsum(v<=threshold)+1*~(v(1)<=threshold))',1:numel(v),[],@(x) {v(x)}) ...

10 years ago | 2

| accepted

Answered
subs don't work properly
syms x a expr=x*a acounted=3/8 subs(expr,a,3/8) 3/8=0.3750, Why do you think 3/8 and 0.3750 are not equal?

10 years ago | 1

| accepted

Answered
How can I make a logical array by comparing two date vectors?
You can use the ismember function

10 years ago | 0

Answered
sum values in a cell array
sum([a{:}]) or you can use cell2mat b=cell2mat(a) out=sum(b)

10 years ago | 15

| accepted

Answered
Initial value for a transfer function
From your second order state space model,you have y=C*[x1;x2] Then if you want to set initial conditions to your states...

10 years ago | 1

| accepted

Answered
How to search for specific numbers and their location in a matrix.
You can use find function,for example A=[-2 1 4 8 9 20] [ii,jj]=find(A>4)

10 years ago | 1

| accepted

Answered
Plotting Input Signal for Transfer Function
H should be a transfer function. In your case, H is a vector of complex numbers.

10 years ago | 0

Answered
zero padding in matrix
a=magic(5) % example b=zeros(200) b(98:102,98:102)=a

10 years ago | 4

| accepted

Answered
How to equalize column?
A = [ 1 2 3 4 5] B = [ 0 0 3] C=[A;B zeros(1,numel(A)-numel(B))]

10 years ago | 0

| accepted

Answered
Splitting vector into shorter vectors of unequal lengths without using a loop?
a=1:10 out=mat2cell(a,1,[2 4 4])

10 years ago | 0

Answered
Replacing a for loop with logical indexing
out=sum(isnan(A))>=3

10 years ago | 1

| accepted

Answered
how to compute number of element in matrix ?
A = [ 1 3 2 0 2 2 1 0 1 2 1 1 ] a=sum(A,2) b=sum(A~=0,2)

10 years ago | 0

| accepted

Answered
how to compare between two images?
A==B % compare image A and image B

10 years ago | 0

| accepted

Answered
I am not able to calculate the number of images saved in a folder
srcFiles2= 'path.. \*. jpg'; n= numel(dir(srcFiles2)) ;

10 years ago | 0

Answered
Count the length of repeated value sets in an array?
x = [1 0 0 1 1 1 0 1 0 1 1 0 0 0] out=nonzeros(accumarray(nonzeros(x.*(cumsum(~x)+1)),1))

10 years ago | 2

Answered
What should i download for a Windows 32 bit system?
You can use Matlab 2015b.

10 years ago | 0

Answered
Extract data from structure and change it to Numerical matrix
M= 100; data = cell(1, M); for k = 1:N N= sprintf('Data%d.xlsx', k); data{k} = xlsread(N); end

10 years ago | 0

Answered
May I ask how to choose random prime number in fix interval?
a=primes(30); out=a(a>=2)

10 years ago | 1

Answered
How to make the matrix only containing the value from 25 line?
A(25:end,:) Read the documentation about Matrix indexing <http://www.mathworks.com/company/newsletters/articles/matrix-inde...

10 years ago | 0

Answered
how to create a triangular geometry in matlab using loop?
You don't need a loop to create a triangle, just set the coordinate of your triangle. For example t=[0 10 5 0] y=[0 0 5 ...

10 years ago | 0

Answered
How to load multiple data into separate variable?
It's a bad idea to create several variables, when you can use one (cella array) % clc file_path='D:\data\ZO_0034\'; file_...

10 years ago | 1

| accepted

Answered
Longest Sequence of 1s
n=[1 1 1 1 0 0 0 1 1 1 1] longest=max(accumarray(nonzeros((cumsum(~n)+1).*n),1)) If n is a string n='1 1 1 1 0 0 ...

10 years ago | 1

Answered
How to add 1 matrix to another matrix ?
[n1,m1]=size(x) [n2,m2]=size(y) z=zeros(n1,m2) idx=ismember(x,y(:,1:m1),'rows') z(idx,:)=y z(~idx,1:m1)=x(~idx,:)

10 years ago | 1

Answered
Find function - index by rows?
Apply find function to the transpose of your matrix find(A'==2) % for example

10 years ago | 0

Answered
Matlab online vs Matlab
If you have a Matlab licence, you can use Matlab online. Matlab online doesn't replace your Matlab software

10 years ago | 0

| accepted

Answered
if we use the instruction [~, idx]=sort(abs(A(:))), what is this ~ (NOT) sign represents
[e, idx]=sort([2 1 5 8 6]) will return e= [1 2 5 6 8] idx=[2 1 3 5 4] [~, idx]=sort([2 1 5 8 6] will return j...

10 years ago | 0

Answered
To delete the empty fields in the dataset
V={5 [];4 6;[] 8;7 8;[] []} idx=cellfun(@isempty,V) V(any(idx,2),:)=[]

10 years ago | 0

| accepted

Answered
How to log/save a Simulink signal to csv/xls file
If you can export your signal to workspace, then you can use xlswrite to save your data in Excel file

10 years ago | 0

Load more