我的矩阵如下
a =
1 3
2 5
3 2
4 8
5 9
Run Code Online (Sandbox Code Playgroud)
我想对a
矩阵中的第二列进行排序.我希望第一列的相应行打印如下:
a =
3 2
1 3
2 5
4 8
5 9
Run Code Online (Sandbox Code Playgroud)
我试过了sort(a)
,但它只排序第二列矩阵a
.
load fisheriris
xdata = meas(51:end,3:4);
group = species(51:end);
svmStruct = svmtrain(xdata,group,'showplot',true);
species = svmclassify(svmStruct,[5 2],'showplot',true)
hold on;plot(5,2,'ro','MarkerSize',12);hold off
Run Code Online (Sandbox Code Playgroud)
上面的代码给出了结果--->species = 'virginica'
该物种被归类为“弗吉尼亚”。这只是一张图片。这个分类过程可以称为“图像检索”吗???
或者我们是否必须检索许多图像才能将其称为图像检索?
我有一个矩阵
a = [ 1 'cancer'
2 'cancer'
3 'cancer'
4 'noncancer'
5 'noncancer' ]
Run Code Online (Sandbox Code Playgroud)
我有另一个有价值的矩阵
b = [ 4
5
2 ]
Run Code Online (Sandbox Code Playgroud)
现在我必须将b矩阵值与a的值进行比较,输出应该是
output = [ 4 'noncancer'
5 'noncancer'
2 'cancer']
Run Code Online (Sandbox Code Playgroud)
我怎么能在matlab中做到这一点?
我需要一个矩阵,在一列中有数字,在matlab中需要另一列中的字符串
a = [ 1 'cancer'
2 'cancer'
3 'cancer'
4 'noncancer'
5 'noncancer' ]
Run Code Online (Sandbox Code Playgroud)
我无法将字符串添加到数组中.