『壹』 如何獲取圖中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就是四核