‘壹’ 如何获取图中4个Cell里面的各个uitextfield输入的值,并且把这些值按点击立即购买button按钮传入数据库
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"LabelTextFieldCell";
LabelTextFieldCell *cell = (LabelTextFieldCell *)[tableView :CellIdentifier];
if (cell == nil) {
//根据nib,实例化cell
NSArray *nib = [[UINib nibWithNibName:@"LabelTextFieldCell" bundle:nil] instantiateWithOwner:self options:nil];
cell= (LabelTextFieldCell *)[nib objectAtIndex:0];
}
// Configure the cell...
//设置text的值
cell.inputText.text = [self.data objectAtIndex:indexPath.row];
//弱类型才可以再块中进行改变
__weak NSMutableArray *dataWeak = self.data;
//具体声明块方法,将text修改后的值,传递回Data中
cell.onTextEntered = ^(NSString * enteredString){
[dataWeak setObject:enteredString atIndexedSubscript:indexPath.row];
};
return cell;
}
‘贰’ excel CELL函数 =INDIRECT("[资料.xls]"&$A4&"!"&CELL("address",$C$13)) 这个公式是什么意思
整个函数将返回资料.xls这个文件中的工作表(表名由$A4单元格的值确定)的C13单元格的值。
CELL("address",$C$13)
CELL(info_type,reference)
返回某一引用区域的左上角单元格的格式、位置或内容等信息。
这里返回单元格$C$13的绝对引用文本值:"$C$13"
INDIRECT(ref_text,a1)
返回由文本字符串指定的引用。此函数立即对引用进行计算,并显示其内容。
如果ref_text是对另一个工作簿的引用(外部引用),则那个工作簿必须被打开。如果源工作簿没有打开,函数INDIRECT返回错误值#REF!。
A1为一逻辑值,指明包含在单元格ref_text中的引用的类型。
如果a1为TRUE或省略,ref_text被解释为A1-样式的引用。
如果a1为FALSE,ref_text被解释为R1C1-样式的引用。
‘叁’ 找一篇关于超声波NDT的英文文献
Introction
vibrations of frequencies greater than the upper limit of the audible range for humans—that is, greater than about 20 kilohertz. The term sonic is applied to ultrasound waves of very high amplitudes. Hypersound, sometimes called praetersound or microsound, is sound waves of frequencies greater than 1013 hertz. At such high frequencies it is very difficult for a sound wave to propagate efficiently; indeed, above a frequency of about 1.25 × 1013 hertz, it is impossible for longitudinal waves to propagate at all, even in a liquid or a solid, because the molecules of the material in which the waves are traveling cannot pass the vibration along rapidly enough.
TableMany animals have the ability to hear sounds in the human ultrasonic frequency range. Some ranges of hearing for mammals and insects are compared with those of humans in the Table. A presumed sensitivity of roaches and rodents to frequencies in the 40 kilohertz region has led to the manufacture of “pest controllers” that emit loud sounds in that frequency range to drive the pests away, but they do not appear to work as advertised.
Transcers
An ultrasonic transcer is a device used to convert some other type of energy into an ultrasonic vibration. There are several basic types, classified by the energy source and by the medium into which the waves are being generated. Mechanical devices include gas-driven, or pneumatic, transcers such as whistles as well as liquid-driven transcers such as hydrodynamic oscillators and vibrating blades. These devices, limited to low ultrasonic frequencies, have a number of instrial applications, including drying, ultrasonic cleaning, and injection of fuel oil into burners. Electromechanical transcers are far more versatile and include piezoelectric and magnetostrictive devices. A magnetostrictive transcer makes use of a type of magnetic material in which an applied oscillating magnetic field squeezes the atoms of the material together, creating a periodic change in the length of the material and thus procing a high-frequency mechanical vibration. Magnetostrictive transcers are used primarily in the lower frequency ranges and are common in ultrasonic cleaners and ultrasonic machining applications.
By far the most popular and versatile type of ultrasonic transcer is the piezoelectric crystal, which converts an oscillating electric field applied to the crystal into a mechanical vibration. Piezoelectric crystals include quartz, Rochelle salt, and certain types of ceramic. Piezoelectric transcers are readily employed over the entire frequency range and at all output levels. Particular shapes can be chosen for particular applications. For example, a disc shape provides a plane ultrasonic wave, while curving the radiating surface in a slightly concave or bowl shape creates an ultrasonic wave that will focus at a specific point.
Piezoelectric and magnetostrictive transcers also are employed as ultrasonic receivers, picking up an ultrasonic vibration and converting it into an electrical oscillation.
Applications in research
One of the important areas of scientific study in which ultrasonics has had an enormous impact is cavitation. When water is boiled, bubbles form at the bottom of the container, rise in the water, and then collapse, leading to the sound of the boiling water. The boiling process and the resulting sounds have intrigued people since they were first observed, and they were the object of considerable research and calculation by the British physicists Osborne Reynolds and Lord Rayleigh, who applied the term cavitation to the process of formation of bubbles. Because an ultrasonic wave can be used carefully to control cavitation, ultrasound has been a useful tool in the investigation of the process. The study of cavitation has also provided important information on intermolecular forces.
Research is being carried out on aspects of the cavitation process and its applications. A contemporary subject of research involves emission of light as the cavity proced by a high-intensity ultrasonic wave collapses. This effect, called sonoluminescence, is believed to create instantaneous temperatures hotter than the surface of the Sun.
The speed of propagation of an ultrasonic wave is strongly dependent on the viscosity of the medium. This property can be a useful tool in investigating the viscosity of materials. Because the various parts of a living cell are distinguished by differing viscosities, acoustical micros can make use of this property of cells to “see” into living cells, as will be discussed below in Medical applications.
Ranging and navigating
Sonar (sound navigation and ranging) has extensive marine applications. By sending out pulses of sound or ultrasound and measuring the time required for the pulses to reflect off a distant object and return to the source, the location of that object can be ascertained and its motion tracked. This technique is used extensively to locate and track submarines at sea and to locate explosive mines below the surface of the water. Two boats at known locations can also use triangulation to locate and track a third boat or submarine. The distance over which these techniques can be used is limited by temperature gradients in the water, which bend the beam away from the surface and create shadow regions. One of the advantages of ultrasonic waves over sound waves in underwater applications is that, because of their higher frequencies (or shorter wavelengths), the former will travel greater distances with less diffraction.
Ranging has also been used to map the bottom of the ocean, providing depth charts that are commonly used in navigation, particularly near coasts and in shallow waterways. Even small boats are now equipped with sonic ranging devices that determine and display the depth of the water so that the navigator can keep the boat from beaching on submerged sandbars or other shallow points. Modern fishing boats use ultrasonic ranging devices to locate schools of fish, substantially increasing their efficiency.
Even in the absence of visible light, bats can guide their flight and even locate flying insects (which they consume in flight) through the use of sonic ranging. Ultrasonic echolocation has also been used in traffic control applications and in counting and sorting items on an assembly line. Ultrasonic ranging provides the basis of the eye and vision systems for robots, and it has a number of important medical applications (see below).
The Doppler effect
If an ultrasonic wave is reflected off a moving obstacle, the frequency of the resulting wave will be changed, or Doppler-shifted. More specifically, if the obstacle is moving toward the source, the frequency of the reflected wave will be increased; and if the obstacle is moving away from the source, the frequency of the reflected wave will be decreased. The amount of the frequency shift can be used to determine the velocity of the moving obstacle. Just as the Doppler shift for radar, an electromagnetic wave, can be used to determine the speed of a moving car, so can the speed of a moving submarine be determined by the Doppler shift of a sonar beam. An important instrial application is the ultrasonic flow meter, in which reflecting ultrasound off a flowing liquid leads to a Doppler shift that is calibrated to provide the flow rate of the liquid. This technique also has been applied to blood flow in arteries. Many burglar alarms, both for home use and for use in commercial buildings, employ the ultrasonic Doppler shift principle. Such alarms cannot be used where pets or moving curtains might activate them.
Materials testing
Nondestructive testing involves the use of ultrasonic echolocation to gather information on the integrity of mechanical structures. Since changes in the material present an impedance mismatch from which an ultrasonic wave is reflected, ultrasonic testing can be used to identify faults, holes, cracks, or corrosion in materials, to inspect welds, to determine the quality of poured concrete, and to monitor metal fatigue. Owing to the mechanism by which sound waves propagate in metals, ultrasound can be used to probe more deeply than any other form of radiation. Ultrasonic proceres are used to perform in-service inspection of structures in nuclear reactors.
Structural flaws in materials can also be studied by subjecting the materials to stress and looking for acoustic emissions as the materials are stressed. Acoustic emission, the general name for this type of nondestructive study, has developed as a distinct field of acoustics.
High-intensity applications
High-intensity ultrasound has achieved a variety of important applications. Perhaps the most ubiquitous is ultrasonic cleaning, in which ultrasonic vibrations are set up in small liquid tanks in which objects are placed for cleaning. Cavitation of the liquid by the ultrasound, as well as the vibration, create turbulence in the liquid and result in the cleaning action. Ultrasonic cleaning is very popular for jewelry and has also been used with such items as dentures, surgical instruments, and small machinery. Degreasing is often enhanced by ultrasonic cleaning. Large-scale ultrasonic cleaners have also been developed for use in assembly lines.
Ultrasonic machining employs the high-intensity vibrations of a transcer to move a machine tool. If necessary, a slurry containing carborunm grit may be used; diamond tools can also be used. A variation of this technique is ultrasonic drilling, which makes use of pneumatic vibrations at ultrasonic frequencies in place of the standard rotary drill bit. Holes of virtually any shape can be drilled in hard or brittle materials such as glass, germanium, or ceramic.
Ultrasonic soldering has become important, especially for soldering unusual or difficult materials and for very clean applications. The ultrasonic vibrations perform the function of cleaning the surface, even removing the oxide layer on aluminum so that the material can be soldered. Because the surfaces can be made extremely clean and free from the normal thin oxide layer, soldering flux becomes unnecessary.
Chemical and electrical uses
The chemical effects of ultrasound arise from an electrical discharge that accompanies the cavitation process. This forms a basis for ultrasound's acting as a catalyst in certain chemical reactions, including oxidation, rection, hydrolysis, polymerization and depolymerization, and molecular rearrangement. With ultrasound, some chemical processes can be carried out more rapidly, at lower temperatures, or more efficiently.
The ultrasonic delay line is a thin layer of piezoelectric material used to proce a short, precise delay in an electrical signal. The electrical signal creates a mechanical vibration in the piezoelectric crystal that passes through the crystal and is converted back to an electrical signal. A very precise time delay can be achieved by constructing a crystal with the proper thickness. These devices are employed in fast electronic timing circuits.
Medical applications
Although ultrasound competes with other forms of medical imaging, such as X-ray techniques and magnetic resonance imaging, it has certain desirable features—for example, Doppler motion study—that the other techniques cannot provide. In addition, among the various modern techniques for the imaging of internal organs, ultrasonic devices are by far the least expensive. Ultrasound is also used for treating joint pains and for treating certain types of tumours for which it is desirable to proce localized heating. A very effective use of ultrasound deriving from its nature as a mechanical vibration is the elimination of kidney and bladder stones.
Diagnosis
Much medical diagnostic imaging is carried out with X rays. Because of the high photon energies of the X ray, this type of radiation is highly ionizing—that is, X rays are readily capable of destroying molecular bonds in the body tissue through which they pass. This destruction can lead to changes in the function of the tissue involved or, in extreme cases, its annihilation.
One of the important advantages of ultrasound is that it is a mechanical vibration and is therefore a nonionizing form of energy. Thus, it is usable in many sensitive circumstances where X rays might be damaging. Also, the resolution of X rays is limited owing to their great penetrating ability and the slight differences between soft tissues. Ultrasound, on the other hand, gives good contrast between various types of soft tissue.
Ultrasonic scanning in medical diagnosis uses the same principle as sonar. Pulses of high-frequency ultrasound, generally above one megahertz, are created by a piezoelectric transcer and directed into the body. As the ultrasound traverses various internal organs, it encounters changes in acoustic impedance, which cause reflections. The amount and time delay of the various reflections can be analyzed to obtain information regarding the internal organs. In the B-scan mode, a linear array of transcers is used to scan a plane in the body, and the resultant data is displayed on a television screen as a two-dimensional plot. The A-scan technique uses a single transcer to scan along a line in the body, and the echoes are plotted as a function of time. This technique is used for measuring the distances or sizes of internal organs. The M-scan mode is used to record the motion of internal organs, as in the study of heart dysfunction. Greater resolution is obtained in ultrasonic imaging by using higher frequencies—i.e., shorter wavelengths. A limitation of this property of waves is that higher frequencies tend to be much more strongly absorbed.
Because it is nonionizing, ultrasound has become one of the staples of obstetric diagnosis. During the process of drawing amniotic fluid in testing for birth defects, ultrasonic imaging is used to guide the needle and thus avoid damage to the fetus or surrounding tissue. Ultrasonic imaging of the fetus can be used to determine the date of conception, to identify multiple births, and to diagnose abnormalities in the development of the fetus.
Ultrasonic Doppler techniques have become very important in diagnosing problems in blood flow. In one technique, a three-megahertz ultrasonic beam is reflected off typical oncoming arterial blood with a Doppler shift of a few kilohertz—a frequency difference that can be heard directly by a physician. Using this technique, it is possible to monitor the heartbeat of a fetus long before a stethoscope can pick up the sound. Arterial diseases such as arteriosclerosis can also be diagnosed, and the healing of arteries can be monitored following surgery. A combination of B-scan imaging and Doppler imaging, known as plex scanning, can identify arteries and immediately measure their blood flow; this has been extensively used to diagnose heart valve defects.
Using ultrasound with frequencies up to 2,000 megahertz, which has a wavelength of 0.75 micrometre in soft tissues (as compared with a wavelength of about 0.55 micrometre for light), ultrasonic microscopes have been developed that rival light microscopes in their resolution. The distinct advantage of ultrasonic microscopes lies in their ability to distinguish various parts of a cell by their viscosity. Also, because they require no artificial contrast mediums, which kill the cells, acoustic micros can study actual living cells.
Therapy and surgery
Because ultrasound is a mechanical vibration and can be well focused at high frequencies, it can be used to create internal heating of localized tissue without harmful effects on nearby tissue. This technique can be employed to relieve pains in joints, particularly in the back and shoulder. Also, research is now being carried out in the treatment of certain types of cancer by local heating, since focusing intense ultrasonic waves can heat the area of a tumour while not significantly affecting surrounding tissue.
Trackless surgery—that is, surgery that does not require an incision or track from the skin to the affected area—has been developed for several conditions. Focused ultrasound has been used for the treatment of Parkinson's disease by creating brain lesions in areas that are inaccessible to traditional surgery. A common application of this technique is the destruction of kidney stones with shock waves formed by bursts of focused ultrasound. In some cases, a device called an ultrasonic lithotripter focuses the ultrasound with the help of X-ray guidance, but a more common technique for destruction of kidney stones, known as endoscopic ultrasonic disintegration, uses a small metal rod inserted through the skin to deliver ultrasound in the 22- to 30-kilohertz frequency region.
Infrasonics
The term infrasonics refers to waves of a frequency below the range of human hearing—i.e., below about 20 hertz. Such waves occur in nature in earthquakes, waterfalls, ocean waves, volcanoes, and a variety of atmospheric phenomena such as wind, thunder, and weather patterns. Calculating the motion of these waves and predicting the weather using these calculations, among other information, is one of the great challenges for modern high-speed computers.
TableAircraft, automobiles, or other rapidly moving objects, as well as air handlers and blowers in buildings, also proce substantial amounts of infrasonic radiation. Studies have shown that many people experience adverse reactions to large intensities of infrasonic frequencies, developing headaches, nausea, blurred vision, and dizziness. On the other hand, a number of animals are sensitive to infrasonic frequencies, as indicated in the Table. It is believed by many zoologists that this sensitivity in animals such as elephants may be helpful in providing them with early warning of earthquakes and weather disturbances. It has been suggested that the sensitivity of birds to infrasound aids their navigation and even affects their migration.
One of the most important examples of infrasonic waves in nature is in earthquakes. Three principal types of earthquake wave exist: the S-wave, a transverse body wave; the P-wave, a longitudinal body wave; and the L-wave, which propagates along the boundary of stratified mediums. L-waves, which are of great importance in earthquake engineering, propagate in a similar way to water waves, at low velocities that are dependent on frequency. S-waves are transverse body waves and thus can only be propagated within solid bodies such as rocks. P-waves are longitudinal waves similar to sound waves; they propagate at the speed of sound and have large ranges.
When P-waves propagating from the epicentre of an earthquake reach the surface of the Earth, they are converted into L-waves, which may then damage surface structures. The great range of P-waves makes them useful in identifying earthquakes from observation points a great distance from the epicentre. In many cases, the most severe shock from an earthquake is preceded by smaller shocks, which provide advance warning of the greater shock to come. Underground nuclear explosions also proce P-waves, allowing them to be monitored from any point in the world if they are of sufficient intensity.
The reflection of man-made seismic shocks has helped to identify possible locations of oil and natural-gas sources. Distinctive rock formations in which these minerals are likely to be found can be identified by sonic ranging, primarily at infrasonic frequencies.
‘肆’ 如何对cell进行排列remap
进行deep network的训练方法大致如下:
1. 用原始输入数据作为输入,训练出(利用sparse autoencoder方法)第一个隐含层结构的网络参数,并将用训练好的参数算出第1个隐含层的输出。
2. 把步骤1的输出作为第2个网络的输入,用同样的方法训练第2个隐含层网络的参数。
3. 用步骤2 的输出作为多分类器softmax的输入,然后利用原始数据的标签来训练出softmax分类器的网络参数。
4. 计算2个隐含层加softmax分类器整个网络一起的损失函数,以及整个网络对每个参数的偏导函数值。
5. 用步骤1,2和3的网络参数作为整个深度网络(2个隐含层,1个softmax输出层)参数初始化的值,然后用lbfs算法迭代求出上面损失函数最小值附近处的参数值,并作为整个网络最后的最优参数值。
上面的训练过程是针对使用softmax分类器进行的,而softmax分类器的损失函数等是有公式进行计算的。所以在进行参数校正时,可以对把所有网络看做是一个整体,然后计算整个网络的损失函数和其偏导,这样的话当我们有了标注好了的数据后,就可以用前面训练好了的参数作为初始参数,然后用优化算法求得整个网络的参数了。但如果我们后面的分类器不是用的softmax分类器,而是用的其它的,比如svm,随机森林等,这个时候前面特征提取的网络参数已经预训练好了,用该参数是可以初始化前面的网络,但是此时该怎么微调呢?因为此时标注的数值只能在后面的分类器中才用得到,所以没法计算系统的损失函数等。难道又要将前面n层网络的最终输出等价于第一层网络的输入(也就是多网络的sparse autoencoder)?本人暂时还没弄清楚,日后应该会想明白的。
关于深度网络的学习几个需要注意的小点(假设隐含层为2层):
利用sparse autoencoder进行预训练时,需要依次计算出每个隐含层的输出,如果后面是采用softmax分类器的话,则同样也需要用最后一个隐含层的输出作为softmax的输入来训练softmax的网络参数。
由步骤1可知,在进行参数校正之前是需要对分类器的参数进行预训练的。且在进行参数校正(Finetuning )时是将所有的隐含层看做是一个单一的网络层,因此每一次迭代就可以更新所有网络层的参数。
另外在实际的训练过程中可以看到,训练第一个隐含层所用的时间较长,应该需要训练的参数矩阵为200*784(没包括b参数),训练第二个隐含层的时间较第一个隐含层要短些,主要原因是此时只需学习到200*200的参数矩阵,其参数个数大大减小。而训练softmax的时间更短,那是因为它的参数个数更少,且损失函数和偏导的计算公式也没有前面两层的复杂。最后对整个网络的微调所用的时间和第二个隐含层的训练时间长短差不多。
程序中部分函数:
[params, netconfig] = stack2params(stack)
是将stack层次的网络参数(可能是多个参数)转换成一个向量params,这样有利用使用各种优化算法来进行优化操作。Netconfig中保存的是该网络的相关信息,其中netconfig.inputsize表示的是网络的输入层节点的个数。netconfig.layersizes中的元素分别表示每一个隐含层对应节点的个数。
[ cost, grad ] = stackedAECost(theta, inputSize, hiddenSize, numClasses, netconfig,lambda, data, labels)
该函数内部实现整个网络损失函数和损失函数对每个参数偏导的计算。其中损失函数是个实数值,当然就只有1个了,其计算方法是根据sofmax分类器来计算的,只需知道标签值和softmax输出层的值即可。而损失函数对所有参数的偏导却有很多个,因此每个参数处应该就有一个偏导值,这些参数不仅包括了多个隐含层的,而且还包括了softmax那个网络层的。其中softmax那部分的偏导是根据其公式直接获得,而深度网络层那部分这通过BP算法方向推理得到(即先计算每一层的误差值,然后利用该误差值计算参数w和b)。
stack = params2stack(params, netconfig)
和上面的函数功能相反,是吧一个向量参数按照深度网络的结构依次展开。
[pred] = stackedAEPredict(theta, inputSize, hiddenSize, numClasses, netconfig, data)
这个函数其实就是对输入的data数据进行预测,看该data对应的输出类别是多少。其中theta为整个网络的参数(包括了分类器部分的网络),numClasses为所需分类的类别,netconfig为网络的结构参数。
[h, array] = display_network(A, opt_normalize, opt_graycolor, cols, opt_colmajor)
该函数是用来显示矩阵A的,此时要求A中的每一列为一个权值,并且A是完全平方数。函数运行后会将A中每一列显示为一个小的patch图像,具体的有多少个patch和patch之间该怎么摆设是程序内部自动决定的。
matlab内嵌函数:
struct:
s = sturct;表示创建一个结构数组s。
nargout:
表示函数输出参数的个数。
save:
比如函数save('saves/step2.mat', 'sae1OptTheta');则要求当前目录下有saves这个目录,否则该语句会调用失败的。
实验结果:
第一个隐含层的特征值如下所示:
第二个隐含层的特征值显示不知道该怎么弄,因为第二个隐含层每个节点都是对应的200维,用display_network这个函数去显示的话是不行的,它只能显示维数能够开平方的那些特征,所以不知道是该将200弄成20*10,还是弄成16*25好,很好奇关于deep learning那么多文章中第二层网络是怎么显示的,将200分解后的显示哪个具有代表性呢?待定。所以这里暂且不显示,因为截取200前面的196位用display_network来显示的话,什么都看不出来:
没有经过网络参数微调时的识别准去率为:
Before Finetuning Test Accuracy: 92.190%
经过了网络参数微调后的识别准确率为:
After Finetuning Test Accuracy: 97.670%
‘伍’ 请教第二代内存DDR2 SDRAM 新增了的4位数据预取是个什么东西,为什么是核心cell工作频率
在SDRAM中,SDRAM也就是同步DRAM,它的数据传输率是和时钟周期同步的,SDRAM的DRAM核心频率和时钟频率以及数据传输率都一样。以PC-133SDRAM为例,它的核心频率/时钟频率/数据传输率分别是133MHz/133MHz/133Mbps。
具体参考http://blog.sina.cn/dpool/blog/s/blog_541f6f430100fvww.html
‘陆’ 在excel中:我输入一个结果在规定的数字中选出4个数字相乘除等于这个结果
可以按下图这样做。
1.2962963是两单元格的乘积(B列是从1.2962963开始按0.01递减,C列=1.2962963除以B列),两单元格格式为分数形式(要设成分数格式后自定义为???/??格式)
‘柒’ 我在matlab中想使用kmeans算法分类,但是我的数据每个都是49*4维的,不知道怎么输入啊,是要用cell么
x = [1,6,9,13,2,8,7,4,11,5,3,10,12];
numGroups = 4; % 组的数目
xMax = max(x);
xMin = min(x);
boundries = xMin + (0:numGroups) * (xMax - xMin) / (numGroups - 1); % 组的边界
xGroup = zeros(size(x)); % 初始化
for group = 1:numGroups
loc = (x >= boundries(group)) & (x <= boundries(group + 1)); %在这个组的书的坐标
xGroup(loc) = group;
end
结果存在xGroup里
补充:
如果要按照你的那样输出,可以改成这样:
x = [1,6,9,13,2,8,7,4,11,5,3,10,12];
GroupName = ['A','B','C','D'];
numGroups = length(GroupName); % 组的数目
xMax = max(x);
xMin = min(x);
boundries = xMin + (0:numGroups) * (xMax - xMin) / (numGroups - 1); % 组的边界
xGroup = zeros(size(x)); % 初始化
for group = 1:numGroups
loc = (x >= boundries(group)) & (x <= boundries(group + 1)); %在这个组的书的坐标
xGroup(loc) = group;
end
xGroupName = GroupName(xGroup);
for ii = 1:length(x)
fprintf('%d : %s\n', x(ii), xGroupName(ii));
end
‘捌’ 在matlab元胞数组中如何在第一个cell中添加一个元素
貌似不可能吧。
个人理解:a=[1,2];b=[3,4];c=[a,b];那怎么读取c中的元素名称,貌似c直接存储数,而不存元素名称吧。
以上仅个人理解,不知对错。
‘玖’ matlab的cell语句
使用方法 c = cell(n) 创建n*n个空矩阵的元胞数组。如果参数n不是标量,就会报错。 c = cell(m, n)或c = cell([m, n]) 创建m*n个空矩阵的元胞数组。参数m和n必须为标量。 c = cell(m, n, p,...)或c = cell([m n p ...]) 创建m*n*p*...个空矩阵的元胞数组,参数m,n,p,...必须为标量。 《Simulink与信号处理》 c = cell(size(A)) 创建一个元胞数组,它包含与矩阵A同维数的空矩阵。 c = cell(javaobj) 把Java数组或Java对象javaobj转换成一个MATLBA元胞数组。 由此产生的元胞数组的元素是MATLAB类型之一,它非常接近于Java数组元素或Java对象。 应用举例: 例一:下面例子将产生一个元胞数组,并对它进行赋值与输出 A = cell(2) A = [] [] [] [] A{1, 1} = zeros(5); A{1, 2} = ones(3); A{2, 1} = 'Hello, World'; A{2, 2} = [0 2 3]; A = [1x2 double] [3x3 double] 'Hello, World' [1x3 double] for i=1:2 for j = 1:2 A{i, j} end end ans = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ans = 1 1 1 1 1 1 1 1 1 ans = Hello, World ans = 0 2 3 例二:下面一个例子将产生一个与矩阵A同维数的元胞数组,其元素都是空矩阵 A = ones(2,2) A = 1 1 1 1 c = cell(size(A)) c = [] [] [] [] 例三:下面一个例子将把一个java.lang.String对象数组转换成一个MATLAB元胞数组 strArray = java_array('java.lang.String', 3); strArray(1) = java.lang.String('one'); strArray(2) = java.lang.String('two'); strArray(3) = java.lang.String('three'); cellArray = cell(strArray) cellArray = 'one' 'two' 'three'
‘拾’ 电脑配置 4 cell 什么意思
如果是电源就是四芯电源 如果是CPU就是四核