Answered
edit-error in replacing values
<<http://img685.imageshack.us/img685/9863/forkash.png>>

14 years ago | 0

| accepted

Answered
converting a cell array into a structured array
try C1 = C{1}; cn = permute(cat(3,name,C1),[3 2 1]); new1 = struct(cn{:});

14 years ago | 0

Answered
how to sort a matrix
eg a = 12 b = 125 A = randi([a b],20,1) c = (a + b)/2; B = A(A < c)

14 years ago | 0

Answered
error in writing to excel sheet
A=1e5*[0.000001380000000 0.000001380000000 0.000001380000000 0.000001380000000 0.000001380000000 0...

14 years ago | 0

Answered
How to generate unique random integers between 1 to n (no two should be same)
n = 8 l = 5 out = randperm(n,l) OR out1 = randperm(n) out = out1(1:l)

14 years ago | 6

| accepted

Answered
Droping elements in a matrix
eg A = sort(randperm(9,6).') B = arrayfun(@(i1)A(i1)*ones(randi([4 6]),1),1:numel(A),'un',0); B = cat(1,B{:}) ...

14 years ago | 0

Answered
Help in performing Numerical integration
>> C = 1.17*10^6; I_s = 82; r = linspace(0.042,0.05,100); I = 2.*pi.*r.*I_s.*(exp(-0.079.*(50-r))+6*10^(-9)*C^(-2.5))...

14 years ago | 0

| accepted

Answered
Forming a matrix
out = {[0.111 0.112 0.113 0.114 0.115 0.116 0.117 0.118],[0.119 0.1201 0.121 0.122 0.123 0...

14 years ago | 2

| accepted

Answered
variables form strucutre
EDIT after comment from Iestyn d = Final.data; k = [Final.textdata(2:end);mat2cell(d,size(d,1),ones(size(d,2),1))]; o...

14 years ago | 0

Answered
Cellfunc
f1=@(x_1,x_2) (x_1-2)^2+x_2; f2=@(x_1,x_2) sqrt(x_2-1); ff = {f1; f2}; x = [5 7]; F = @(x)cellfun(...

14 years ago | 0

| accepted

Answered
Struct array
out = [data.bidPrice] or out = cat(1,data.bidPrice) ets.

14 years ago | 0

| accepted

Answered
Extracting characters out of a string array
c = {'20/02/201205:45:00PM';'21/02/201205:45:00AM'} out = datenum(c,'dd/mm/yyyyHH:MM:SSPM') out2 = datestr(out,'dd/m...

14 years ago | 0

| accepted

Answered
area under graph
>> doc trapz _ADD_ c - your matrix "of flows" dt = .5 % eg .5 sec timeColumn = dt*(0:size(c,1)-1).'

14 years ago | 0

Answered
binary to string
a = reshape(s-'0',[],3)' out = sprintf('%d',(a*(2.^(size(a,2)-1:-1:0).'))') *OR* a = reshape(s,[],3)' out = spri...

14 years ago | 1

Answered
Data Analysis - need to omit certain values from an array as well as resample
1) data = data(data <= max_value) 2) Give us an example.

14 years ago | 0

Answered
how to create matrix using vectors
A = bsxfun(f,B.',C) % f = @(x,y)....

14 years ago | 0

| accepted

Answered
Computing an equation
syms t A = 35; g = 9.81; v = 10; h = v*t*sind(A)-(1/2)*g*t^2; x = v*t*cosd(A); t_hmax = solve(diff(h,t),t); ...

14 years ago | 0

Answered
split array
A = 1234567891234567 B = reshape(num2str(A)-'0',[],2).' Anew = B*10.^(size(B,2)-1:-1:0).'

14 years ago | 0

Answered
Selecting values without using randperm
try this is A=F_mid; [r10 c10]=size(A) out = A(fix(linspace(1,r10,r10-7)),:);

14 years ago | 0

| accepted

Answered
selecting even rows
|A| - your matrix A = randi(23,14,6) out = A(2:2:end,:)

14 years ago | 3

| accepted

Answered
Matrix summation within a loop
Phi2 = zeros(size(V,2),size(U,1)); for j1 = 1:size(V,2) Phi2(j1,:) = 1/ai^2*sum(V(:,j1)*U(:,j1).'); end OR ...

14 years ago | 1

| accepted

Answered
Switch case (how to use for case insensitive string check)
try str1 = lower(str); switch str1 case 'power'

14 years ago | 1

Answered
Matrix issue.
your code X =unifrnd(0,1,1,15); i1 = 1; while i1 <= numel(X) if X(i1)<=0.2 X(i1)= 1; ...

14 years ago | 0

Answered
dividing image into 64 blocks
I - your image [m n k] = size(I) outIblocks = mat2cell(I,m/8*ones(8,1),n/8*ones(8,1),k)

14 years ago | 1

| accepted

Answered
how to speed up this nestled for loop
try this is code exyz = zeros(size(M(:,4:6))); t = all(M(:,1:2) >= -70 & M(:,1:2) <= 70,2); exyz(t,:) = M(t,4:6); ...

14 years ago | 1

Answered
How to find the distance between two non-zero (the element is a one) elements in a matrix
use function |pdist| from |Statistics Toolbox| a = rand(10)<.07 [i1 j1] = find(a); out = tril(ones(numel(i1)),-1...

14 years ago | 0

| accepted

Answered
meshgrid() confusion (dimesions, index,...)
can so? [ccordX coordZ coordY]=meshgrid(xmin:xmax, zmin:zmax, ymin:ymax) _*ADD*_ [ccordZ coordX coordY]=ndgrid(zmin...

14 years ago | 0

| accepted

Answered
Using find command on each term in a vector
A=-10:10 B=22*rand(1,30)-11 out = find(all(bsxfun(@gt,A.',B),2),1,'first')

14 years ago | 1

Answered
averages of cell array
try this is pathName = ... TopFolder = pathName; dirListing = dir(fullfile(TopFolder,'*.txt')); cell_all = arrayf...

14 years ago | 1

| accepted

Answered
How to copy copy column with loop?
A = [ 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8 1 2 3 4 5 6 7 8] out = [A(:,ones(3,1)) A A(:,end*ones(2,1))] OR out...

14 years ago | 1

Load more