[Solved] Inserting a vector from Octave, each element being in one cell

Discuss the spreadsheet application
Locked
mtnylmz
Posts: 123
Joined: Fri Jul 22, 2022 2:28 am

[Solved] Inserting a vector from Octave, each element being in one cell

Post by mtnylmz »

Hello, I am very new to OpenOffice. I want to insert a vector into a sheet, each element being in one cell. Would you please explain me how to do that operation?

Regards,
Last edited by MrProgrammer on Fri Jul 29, 2022 4:11 pm, edited 2 times in total.
Reason: Tagged ✓ [Solved] -- MrProgrammer, forum moderator
OppenOffice 4.1.12 on Windows 10
FJCC
Moderator
Posts: 9619
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Inserting a vector, each element being in one cell

Post by FJCC »

Where is this vector coming from? Do you want to Copy/Paste data into Calc or read data from a file?
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
mtnylmz
Posts: 123
Joined: Fri Jul 22, 2022 2:28 am

Re: Inserting a vector, each element being in one cell

Post by mtnylmz »

I created the vector in Octave. I want to put it into the spreadsheet. Each element of the vector should occupy one cell. If it is a row vector, elements should occupy cells of a row.
OppenOffice 4.1.12 on Windows 10
FJCC
Moderator
Posts: 9619
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Inserting a vector, each element being in one cell

Post by FJCC »

It seems like you want to have Octave interact directly with OpenOffice. That would require using the API (Application Programming Interface) and there is no way for Octave to do that, as far as I know. The easiest way to make the transfer is probably to write the data out of Octave to a text file and read that file into Calc.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
User avatar
MrProgrammer
Moderator
Posts: 5424
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Inserting a vector, each element being in one cell

Post by MrProgrammer »

mtnylmz wrote: Fri Jul 22, 2022 2:34 am Hello, I am very new to OpenOffice.
Hi, and welcome to the forum. I suggest you read this tutorial: [Tutorial] Ten concepts that every Calc user should know

mtnylmz wrote: Fri Jul 22, 2022 4:06 pm I created the vector in Octave. I want to put it into the spreadsheet.
You have a set of numbers in Octave. You want to put them in a spreadsheet. Thus you need to export this data from Octave and import it to Calc. For a row vector, Calc will expect the import to be in the form of a string, consisting of the numbers separated by delimiters. Traditional delimiters are comma, tab, or semicolon. An example string is 3.14159,2.71828,1.6080. You have not indicated your locale. Some locales use comma as the decimal separator, thus they cannot also use comma as a delimiter. You have four choices:
• Arrange for Octave to export the data in the format that Calc wants; import to Calc
• Export the data in some other format, then use Writer to convert that to the format Calc wants; import to Calc
• Export the data in some other format, then use an external tool like Perl or awk or bash to convert it; import to Calc
• Export the data in some other format, import to Calc; manipulate the import in Calc into a row vector
Since you are new to Calc, the last choice may be difficult for you.

This is an OpenOffice forum, so you should not expect anyone here to know how to export data from Octave. I don't. If you do not know how to export, you could consult an Octave forum for assistance. It would be best to specifically ask how to export the data in the format that Calc wants. If you do know how to export, but don't know how to get the export in the format that Calc wants, then you should attach a document to provide exported data so we can consider ways to convert it (remove confidential information then use Post Reply, not Quick Reply, and don't attach a picture instead of the document itself). I will ignore any picture of the export. Make sure your sample export is representative of the real situation.

Once the data from Octave is in the correct format, the export can either be stored in a file, or it can be placed on the clipboard. Storing the data in either place is not done with Calc. For example, perhaps you can use Octave to put the export on the clipboard. (Don't know how?; ask in an Octave forum.) To import, for a file, create one with a name like Octave.csv and use File → Open in OpenOffice since Calc will be used to receive CSV data. For the clipboard, create a new spreadsheet and use Edit → Paste Special → Unformatted Data in Calc.

If this solved your problem please go to your first post use the Edit button and add [Solved] to the start of the subject field. Select the green checkmark icon at the same time.
Mr. Programmer
AOO 4.1.7 Build 9800, MacOS 13.7.8, iMac Intel.   The locale for any menus or Calc formulas in my posts is English (USA).
Locked