From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-01-2010 01:28 AM
data=load('D:\d.txt');
for n=1:240;
t=1024*n; i=t-1024+1;
a=data(i:t,1);
elev=-data(i:t,2);
p=data(i:t,3);
r=-data(i:t,4);
please ane one help how to code in labview for above matlab procedue.. urgent please
thanks & regards
srinath
04-01-2010 01:43 AM
Hi adapa,
can you explain a bit? What is it doing?
Is it a loop over the following lines?
You can load it like shown in the attached picture.
Mike
04-01-2010 07:22 AM
Use array index to get the vectors a, elev, p, and r.
Lynn
04-01-2010 10:40 PM
ya after that loop will be over
the meaning of the above matlab coding is
here i am sending text file also.. here the first column shows the data of the ''a''
the second column shows the data of the ''elev''
the thied column shows the data of the ''p''
the first column shows the data of the ''r''
for n =1:240; shows that loop count is 1 to 240
t=1024*n; i=t-1024+1; shows the conditions
a=data(i:t,1); shows during hte first loop it has to read first column 1024 values and during the 2nd loop count t has to read first column 1025 to next 2048 values and cont.. up to 140 times
elev=-data(i:t,2); shows during first loop it has to read 2nd column 1024 values and during the 2nd loop count 2ndhas to read 2nd column 1025 to next 2048 values and cont.. up to 140 times
p=data(i:t,3); shows during first loop it has to read 3rd column 1024 values and during the 2nd loop count 2ndhas to read 3rd column 1025 to next 2048 values and cont.. up to 140 times
r=-data(i:t,4);shows during first loop it has to read4th column 1024 values and during the 2nd loop count 2ndhas to read 4th column 1025 to next 2048 values and cont.. up to 140 times
end
i think ex:
thanks and regards
srinath
04-01-2010 10:46 PM
Syntax
silhouette(X,clust)
s = silhouette(X,clust)
[s,h] = silhouette(X,clust)
[...] = silhouette(X,clust,metric)
[...] = silhouette(X,clust,distfun,p1,p2,...)
silhouette(X,clust) plots cluster silhouettes for the n-by-p data matrix X, with clusters defined by clust. Rows of X correspond to points, columns correspond to coordinates. clust can be a categorical variable, numeric vector, character matrix, or cell array of strings containing a cluster name for each point. (See Grouped Data.) silhouette treats NaNs or empty strings in clust as missing values, and ignores the corresponding rows of X. By default, silhouette uses the squared Euclidean distance between points in X.
s = silhouette(X,clust) returns the silhouette values in the n-by-1 vector s, but does not plot the cluster silhouettes.
[s,h] = silhouette(X,clust) plots the silhouettes, and returns the silhouette values in the n-by-1 vector s, and the figure handle in h.
[...] = silhouette(X,clust,metric) plots the silhouettes using the inter-point distance function specified in metric. Choices for metric are given in the following table.
Metric | Description |
---|---|
'Euclidean' | Euclidean distance |
'sqEuclidean' | Squared Euclidean distance (default) |
'cityblock' | Sum of absolute differences |
'cosine' | One minus the cosine of the included angle between points (treated as vectors) |
'correlation' | One minus the sample correlation between points (treated as sequences of values) |
'Hamming' | Percentage of coordinates that differ |
'Jaccard' | Percentage of nonzero coordinates that differ |
Vector | A numeric distance matrix in upper triangular vector form, such as is created by pdist. X is not used in this case, and can safely be set to[]. |
[...] = silhouette(X,clust,distfun,p1,p2,...) accepts a function handle distfun to a metric of the form
d = distfun(X0,X,p1,p2,...)
where X0 is a 1-by-p point, X is an n-by-p matrix of points, and p1,p2,... are optional additional arguments. The function distfun returns an n-by-1 vector d of distances between X0 and each point (row) in X. The arguments p1, p2,... are passed directly to the function distfun.
The silhouette value for each point is a measure of how similar that point is to points in its own cluster compared to points in other clusters, and ranges from -1 to +1. It is defined as
S(i) = (min(b(i,:),2) - a(i)) ./ max(a(i),min(b(i,:)))
where a(i) is the average distance from the ith point to the other points in its cluster, and b(i,k) is the average distance from the ith point to points in another cluster k.
X = [randn(10,2)+ones(10,2);randn(10,2)-ones(10,2)];cidx = kmeans(X,2,'distance','sqeuclid');s = silhouette(X,cidx,'sqeuclid');
04-01-2010 10:49 PM
hai
i used it . but i didnt get as per my requirement.
i attached my text file also ...
and working principle also i given in above posts .
can u try based on that .....
thanks & regards
srinath
04-01-2010 10:52 PM
04-02-2010 09:01 AM