cell

Preallocate structure of cells in matlab

只愿长相守 提交于 2019-12-11 01:46:40
问题 I use a structure called test with the following "layout" (result of whos test, test ) Name Size Bytes Class Attributes test 1x1 8449048 struct test = timestamp: {[7.3525e+05] [7.3525e+05] [7.3525e+05]} timeseries: {[44000x8 double] [44000x8 double] [44000x8 double]} For speed issues, I want to preallocate that with zeros. I found some ways, which result in other "layouts": test2=struct('timestamp',cell(1,3),'timeseries',cell(1,3)); test3=struct('timestamp',{0,0,0},'timeseries',{zeros(44000,8

how to delete empty elements in the cell in a way i want

喜欢而已 提交于 2019-12-11 01:43:37
问题 in MATLAB I have a cell array like this a = { 1 2 2 3 4 5 [] [] 2 4 5 4 3 2 4 5 4 5 4 3 4 [] [] []} I want to remove empty elements in a way that I get this : a = { 1 2 2 3 4 5 2 4 5 4 3 2 4 5 4 5 4 3 4} but when I use this : a(cellfun(@isempty,a)) = []; what I get is this : a = {1 2 4 2 4 5 2 5 4 3 4 3 4 3 4 5 2 4 5} which is not what I want 回答1: The problem is that the linear index runs in the direction of rows, i.e. it runs through the first conlumn, then through the second column etc. You

Excel formula to find reference used by other cell

耗尽温柔 提交于 2019-12-11 01:39:07
问题 Is there a way to find out the address of the cell being referenced in another cell in excel? E.g. cell C1 contains formula =max(A:A) and returns a value of 10 which is actually referenced to cell A10. Can I use a formula in cell B that returns 'A10'? And no, I don't want to use VBA at all. 回答1: Assuming that your entries are in Cells A1:A7, you can do it this way ... In Cell B1 , the formula =MAX(A1:A7) and in Cell B2 , the cell location of the maximum number in the range (shown in B1) is

Behavior of cells in Jtable (right click inside of a cell)

Deadly 提交于 2019-12-11 01:33:35
问题 I have a JTable and I want to open a PopupMenu by a right-click inside a cell. I tried this by making my own AbstractCellEditor , but it doesn't work (When I start my program and when the first method initialize the CellEditor (it´s the last thing that this method do), CellEditor is starting. But at the beginning of the next method the CellEditor has already disapeared). Can somebody please help me? I´m trying to find the error for weeks. This is the Code of CellEditor : public class

Adding shadow effect on iText elements

眉间皱痕 提交于 2019-12-10 23:42:21
问题 I have some problem with iText in Java. I need to produce a cell or rectangle with shadow just like in this example: 4 and 60 are in some kind of cell or rectangle with shadow. I don't know how to do it. Any help ? 回答1: The easiest way probably is to use a Chunk with a generic tag and a PdfPageEvent . This way you'll get an event callback when the Chunk is positioned on the page. The callback will give you the coordinates (rectangle) of the Chunk , allowing you to paint a border and a shadow

gspread or such: help me get cell coordinates (not value)

一个人想着一个人 提交于 2019-12-10 19:57:05
问题 By using GSpread I have a range of cell's returned from a google spreadsheet that has all its elements something like this: <Cell R1C1 'Sandero'> I know how to get from here the cell value: cell.value but I would also like to get the address (R1C1 in this case) separately. It would have to be (R1,C1) or even better if I can get it in (1,1) format (maybe by using a dictionary?) You see I need the address as well because I will later declare a graph with these values. I'm using Python 2.7 and

How to display a text multilined inside a cell of a table in iphone?

戏子无情 提交于 2019-12-10 19:52:41
问题 I am new to iphone development.I am parsing a xml file and displaying the title, date, view and summary in each row of a table.The contents of summary is big ,so only first 3 words are displayed in the cell. I increased the height of the row.Still 3 words are displayed in my cell.How summary should fit properly inside the cell and full content should be displayed.Please help me out.Thanks. 回答1: why dont you set the "numberOfLines" property of the text label of a cell to 0. just like this,

Disable JList Cell Selection Property

流过昼夜 提交于 2019-12-10 18:35:15
问题 I am attempting to display an array of strings in a JList , which is then added to a JPanel using Java Swing . I am not having a problem displaying the data in the Jlists , however I would like to remove the default property that allows a user to select items in the Jlist . I am attempting to simply display the data to the user. Unfortunately I am unable to locate the property that would allow me to disable this feature. A example of the selection property that I am referring to can be seen

How to check if a cell is empty (Excel\VisualC#)

会有一股神秘感。 提交于 2019-12-10 18:08:12
问题 this might be an easy question for you and I saw a lot of topics about it, but none of them gave me the answer I need. My aim is to check line per line in the Sheet1 in order to discover how many rows are, so i put a do\while that should stop once it reaches a blank cell Example: row1 data row2 data row3 data row4 data row5 data row6 data row7 data In this case I need only the first 5 rows, so the do\while check is intended to stop once it reaches the blank cell. This doesn't happens, because

Matlab cellfun on function strfind

心已入冬 提交于 2019-12-10 18:07:37
问题 I want to use cellfun function on strfind function to find the index of each string in a cell array of string in another cell array of strings to exclude them from it. strings = {'aaa','bbb','ccc','ddd','eee','fff','ggg','hhh','iii','jjj'}; excludedStrings = {'b','g','h'}; idx = cellfun('strfind',strings,excludedStrings); idx = cell2mat = idx; idx = reshap(idx,numel(idx),1); idx = unique(idx); strings(cell2mat(idx)) = []; There's error in the cellfun call line, how can I fix this? 回答1: Here's