how to string a data from uitable that been input by the user? - arrays

I'm trying to build a matrix form by creating a uitable in GUIDE. So I want the user to enter data into the table and I want to use the data at the pushbutton. But I dunno how to string the data from the table to the pushbutton. Is there any way to program the table? Im just take callback only. Do I have to take the create function, cellselectionfunc and etc in my m-editor?
I want to make a 3 by 3 matrix, but I cannot edit the row at property inspection. When I delete the 4th row and I apply, its always has 4 rows. I just want to make 3 by 3 matrix. Not 4 by 3.

Assuming the tag property on your uitable is MyTable the following code will get the data from the table.
data = get(handles.MyTable,'Data');
If you put this code into your button callback (assuming your button has a tag of MyButton this will be function MyButton_Callback(hObject, eventdata, handles)) you should be able to see the table data when the button is clicked.
You can initialise the table data in the figures 'OpeningFcn' (which should have been created by Guide) to a 3x3 cell matrix.
handles.output = hObject;
% Initialise MyTable data to a 3x3 matrix
set(handles.MyTable,'Data', cell(3,3));
% Update handles structure
guidata(hObject, handles);

Related

Link two cells in google sheets with autofill

First of all I would like to thank you for your time.
I have a google data studio report that extracts data from a google sheet. The data studio sheet gets values from a google form (in the form of another tab in the sheet). Altough the cells are linked, right now I have to drag the cells in the data studio sheet to pull the values from the forms sheet. If there are no values it can´t pull anything and I would like to have real time values in the google data studio as soon as a form is filled.
Right now all I have is a simple (='Form '!C55) to pull. What I would like to do is if there is a new value in the following cell in the forms sheets then the following cell in the data studio sheets pulls it so it can go to the report in dat studio.
Cheers to all!
Try this formula, in column A, after your last row of good data. So perhaps in Dados!A91. Note you will need to first delete everything in all of the cells below and to the right of A91, since this formula is filling everything:
=QUERY('Formulário '!A9:O;"select A,G,D,J,M,H,E,K,N,I,F,L,O where B <> '' ";0)
This queries your Formulário sheet, and pulls all of the data starting in row 9 (since that is what you were showing with your formula before), and selects all of the correct columns in order.
Please test it out with a test form submission, to see that it works as expected, and that it is copying the correct columns, in the right order. Let me know of any questions or issues.
I'm not positive how sheet updates work when there is no active user logged into the sheet, but I suppose when Data Studio goes to pull from Dados, it will first ensure that it has the latest data from all formulas.
Update
To have the Max and Min values,which you say should be the same all the way down the column, add a formula like the following in the header row (row 1) of your Formulario sheet:
={"Cloro Max.";ArrayFormula(IF(LEN(A2:A);1,5;""))}
That gives a value of 1,5 for a column labelled Cloro Max. Be sure to delete anything from row 2 down, in that same column, or the array formula gives a #REF error, since it can't put data when there is already data entered in those lower cells.
You can change the text to create a Max or Min column for each value you want, in columns Q to V. Change the 1,5 to whatever number you want, such as 0,5 for Cloro Min.
It will always add the value(s) to each new row as it gets added from a submitted form response.

How to control how many cells are triggered in Google Sheets

If I have column A receive 1000 rows of input and column B has some function that takes column A cells as input for some custom function. How do I control how many cells in column B can run at a time? For example
Column A receives input into rows 1-1000. Column B has rows 1-5 trigger. In order words, how to setup concurrency control for columns?
Edit: Referring to the picture - I will paste in 1000 cells of data into column A. I need column B to only process X rows/cells at a time.
based on your picture... if you want to process only 20 rows out of 1000 you could maybe try:
=ARRAYFORMULA(FUNCTION(A1:A20))
ofc if your Function supports the ArrayFormula variation

Array result from INDIRECT

So, I have a Google Sheet connected to a Google Form that I use for debugging a series of games. Each game has a Unit number and an Activity number.
I added to the sheet a column that, basing on the Unit and on the Activity, retrieves the name of the developer, contained in another sheet.
=INDIRECT("Developers!"&CHAR(C1+64+1)&(B1+1))
(I have to add 1 to each value because the other table has headers)
The formula does work on a single cell, but it's not applied to the new lines inserted by the Google Form.
I've seen that ARRAYFORMULA() returns an array that automatically populates the cells below.
Is there a command I can use to apply a formula to an array of values and have an array of results returned?
if you want to get just a range do:
=INDIRECT("Developers!"&ADDRESS(B1+1, C1+1, 4)&":"&ADDRESS(ROWS(A:A), C1+1, 4))
or populated range:
=INDIRECT("Developers!"&ADDRESS(B1+1, C1+1, 4)&":"&ADDRESS(COUNTA(B:B), C1+1, 4))

Array formula having unique values for Data Validation dropdown without using helper column

I am trying to create an array defined name to enter into a data validation dropdown without using any helper columns in the sheet.
I have a table containing one of the column headers called 'List' which contains names of employees. The names may be duplicated, hence I want to extract only the unique names and put them into a data validation dropdown. I don't intent to use VBA and don't want to use any helper columns to drag the formula down to populate the unique names. On pressing F9, the formula should return unique values in an array like this:
{tom;fawad;george;jane;mario;flavia}
The table column looks like this:
List Column 2 Column 3 .....
tom
fawad
george
george
jane
mario
flavia
mario
george
fawad
Right now the formula is returning only one value when pressing F9 key.
=INDEX(list,IFERROR(SMALL(IF(FREQUENCY(MATCH(list,list,0),ROW(INDIRECT("1:"&COUNTA(list)))),ROW(INDIRECT("1:"&COUNTA(list))),""),ROW(INDIRECT("1:"&COUNTA(list)))),""))
I think it may require TRANSPOSE or SUBSTITUTE function to split the returned values across dropdown rows. Someone had demonstrated something like this, but I don't remember the link now.
Anyone know how to create a unique names array formula that I can simply enter directly into a Data Validation dropdown?

ExtJS and simple grid panel

I have a simple grid without direct connection with any database table. Just days of mounth in raws and persons in columns (let's say 31 x 20). In init procedures I read data from some tables, calculate and write them to this grid. Then I have to calculate lot of indexes, make some summs by raws, columns and part of them. Just statistics.
There's no problem with read from grid cells, this is very quick. I have a problem with writing data to the cells. E.g. procedure to fill this grid is the following:
days = Ext.getStore('StoreDays').getRange();
employees = Ext.getStore('StoreTeam').getRange();
Ext.each(days, function (day) {
Ext.each(persons, function (guy) {
tmp = day.get('from');
day.set('start_' + persons.data.prs_numer, start);
... and 4 additional SET operations to grid cells
});
});
And this procedure work more then 3 minutes!!! I don't know why and how to write good code to write this data normally. Be so kind and prompt me HOW!
Additionally I can't refresh e.g. every single raw after raw settings as I want.
Would you be so kind as to prompt me?
A cell update could mean the grid needs to refresh itself, so it does that 31x20x5 (31 rows, 20 columns, 5 times per cell) times!
Instead, do this:
store.suspendEvents();
// Do your update
store.resumeEvents();
grid.getView().refresh();

Resources