-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b45dde7
commit 70f2d06
Showing
57 changed files
with
13,197 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Build C/C++ code on the fly | ||
|
||
Build C/C++ code on the fly | ||
|
||
## Description | ||
|
||
<p>Nelson provides a cross-platform command-line tool written in Nelson for compiling native addon modules for Nelson.</p> | ||
<p>It takes away the pain of dealing with the various differences in build platforms.</p> | ||
|
||
## Example | ||
|
||
```matlab | ||
if ispc() && ~havecompiler() | ||
configuremsvc() | ||
end | ||
C_CONTENT = ["double"; | ||
"functionC(double x)"; | ||
"{"; | ||
" return x + 8;"; | ||
"}"]; | ||
DEST_DIR = [tempdir(), 'example_C']; | ||
mkdir(DEST_DIR); | ||
C_DEST_FILE = [tempdir(), 'example_C/demo.c']; | ||
filewrite(C_DEST_FILE, C_CONTENT) | ||
dlgeneratemake(DEST_DIR, 'C_DEMO', {C_DEST_FILE}, {DEST_DIR}) | ||
[res, message] = dlmake(DEST_DIR) | ||
lib = dlopen([DEST_DIR, '/C_DEMO', getdynlibext()]) | ||
c = dllibinfo(lib) | ||
f = dlsym(lib, 'functionC', 'double', {'double'}); | ||
R = dlcall(f, 3) % 8 + 3 | ||
dlclose(lib) | ||
``` | ||
|
||
<img src="build_c_cpp_on_fly_DE9671CD.png" align="middle"/> | ||
|
||
## See also | ||
|
||
[configuremsvc](configuremsvc.md), [dlgeneratemake](dlgeneratemake.md), [dlmake](dlmake.md), [dlopen](dlopen.md), [dllibinfo](dllibinfo.md), [dlsym](dlsym.md), [dlcall](dlcall.md). | ||
|
||
## History | ||
|
||
| Version | Description | | ||
| ------- | --------------- | | ||
| 1.2.0 | initial version | | ||
|
||
## Author | ||
|
||
Allan CORNET |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# shiftdim | ||
|
||
Shift array dimensions | ||
|
||
## Syntax | ||
|
||
- B = shiftdim(A, n) | ||
- B = shiftdim(A) | ||
- [B, m] = shiftdim(A) | ||
|
||
## Input argument | ||
|
||
- A - Input array: vector, matrix or multidimensional array. | ||
- n - Number of positions: integer value. | ||
|
||
## Output argument | ||
|
||
- B - vector, matrix, or multidimensional array. | ||
- m - Number of dimensions removed: non-negative integer. | ||
|
||
## Description | ||
|
||
<p><b>shiftdim(A, n)</b> reorganizes the dimensions of an array A by n positions.</p> | ||
<p>Specifically, when n is a positive integer, it shifts the dimensions to the left, and when n is a negative integer, it shifts the dimensions to the right.</p> | ||
|
||
## Example | ||
|
||
```matlab | ||
A = rand(2, 3, 4); | ||
size(A) | ||
% Shift the dimensions of array A by 2 positions to the left | ||
B = shiftdim(A, 2) | ||
``` | ||
|
||
## See also | ||
|
||
[permute](permute.md), [reshape](reshape.md), [squeeze](round.md). | ||
|
||
## History | ||
|
||
| Version | Description | | ||
| ------- | --------------- | | ||
| 1.3.0 | initial version | | ||
|
||
## Author | ||
|
||
Allan CORNET |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.