Main Content

find

Find cells in Safety Analysis Manager spreadsheets containing specific values

Since R2023b

Description

example

cells = find(spreadsheet,value) finds the cells in the Safety Analysis Manager spreadsheet, spreadsheet, that contain the specified value.

example

cells = find(spreadsheet,value,Name=Value) finds the cells in the spreadsheet using one or more name-value arguments.

Examples

collapse all

Suppose you have a spreadsheet file named mySpreadsheet.mldatx. Open the spreadsheet in the Safety Analysis Manager and retrieve the spreadsheet as a Spreadsheet object.

mySpreadsheet = safetyAnalysisMgr.openDocument("mySpreadsheet.mldatx");

Find the cells in the spreadsheet that contain the phrase myText.

myCells = find(mySpreadsheet,"mytext");

Suppose you have a spreadsheet file named mySpreadsheet.mldatx. Open the spreadsheet in the Safety Analysis Manager and retrieve the spreadsheet as a Spreadsheet object.

mySpreadsheet = safetyAnalysisMgr.openDocument("mySpreadsheet.mldatx");

Find the cells in the spreadsheet that contain the case-sensitive phrase myText.

myCells = find(mySpreadsheet,"myText",MatchCase=true);

Input Arguments

collapse all

Spreadsheet in the Safety Analysis Manager, specified as a Spreadsheet object.

Value to search for in the spreadsheet cells, specified as a string scalar or a character vector.

Data Types: char | string

Name-Value Arguments

Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Example: find(spreadsheet,"myValue",MatchCase=true) retrieves spreadsheet cells that have the case-sensitive phrase myValue.

Whether to return only case-sensitive matches, specified as a numeric or logical 1 (true) or 0 (false).

Data Types: logical

Whether to return only whole cell content matches, specified as a numeric or logical 1 (true) or 0 (false).

Data Types: logical

Output Arguments

collapse all

Spreadsheet cells that contain the text in the argument value, returned as a SpreadsheetCell object array.

Limitations

  • You cannot use this function to search the contents of check box cells.

Version History

Introduced in R2023b

See Also

Objects

Functions