# Items tagged with arrayarray Tagged Items Feed

### Pixel Conversion...

August 09 2014 Maple 18
3 1

Here is an example of manipulating an Array of pixels. I chose the x-rite ColorChecker as a model so there would be published results to check my work. A number of details about color spaces have become clear through this exercise. The color adaptation process was modeled by converting betweenXYZ and LMS. Different black points may be selected depending on how close to zero illuminance one would accept as a good model.

I look forward to extending this work to verify and improve the color calibration of my photography. Also some experimentation with demosaicing should be possible.

 Initialization

x-rite Colorchecker xyY Matrix

=

=

 Convert xyY to XYZ

=

 XYZ D50 to XYZ D65

=

Convert XYZ to Lab (D50 or D65 White Point)

 Reference White Point for D50  =  =  = Lab Conversion Constants; Reference White Point for D65  =  =  =

=

Convert XYZ to aRGB (XYZ D50 or D65 to aRGB D65)

XYZ Scaling for aRGB Ymax,Ymin (Ref. Adobe RGB (1998) Color Image Encoding Section 4.3.2.2 and 4.3.8)

 White Point (Luminance=160Cd/m^2) D65 Black Point (Luminance=0.5557Cd/m^2) D65 White Point (Luminance=160Cd/m^2) D50 Black Point (Luminance=0.5557Cd/m^2) D50 =  =  = =  =  =

aRGB Expansion for 8bits

Combine Steps

Note: The aRGB values published for ColorChecker assume a black point of 0cd/m^2.

=

=

 Convert XYZ to ProPhoto RGB (D50)

=

 Convert XYZ to sRGB (XYZ D50 or D65 to sRGB D65)

Note: The sRGB values published for ColorChecker assume a black point of 0cd/m^2.

=

=

### how to rotate or flip a matrix ?...

July 22 2014
1 2

i have a work on Magic Squares , and i need to rotate or flip them to all 8 possible directions .
but i am confused to find such special commands in maple for doing my purpose !

may you guide me how can i do this programmaticaly ?

 >
 (1)
 >

### convert data readed from text file to array ?...

July 12 2014
0 4

i have read data from a text file. i want to convert this data to array,how should i do that ?

for example :
i have readed these files and i want convert them to array which for the first one,has 3 rows and 4 columns.
what should i do ?

 > restart:
 (1)
 (2)
 >

### Changing a Global Parameter for each evaluation in...

July 06 2014
1 3

I have a rank 1 array M of 1000 values.

I want to apply a function f on each value of M and its location giving,

[f(1,M[1]), f(2,M[2]), ... , f(1000,M[1000])]

is it possible to get this using map or map2 or map[n] or maptype (without using seq since its slowing down computation).

inotherwords can i access the member location inside a map evaluation?

### how to convert to array from matrix...

June 25 2014
0 2

want to export to excel to file from matrix

Error, (in FindLambda) invalid input: `convert/Array` expects its 1st argument, A, to be of type {Array, Matrix, Vector, array, list, listlist}, but received csvfile
csvfile = Matrix(30,7);

print(close3(t+i), rhs(Sol5[1][1]), ratioA, oddsratio, oddsratioSimUp, oddsratioSimDown,1);
csvfile[i+1,1] := close3(t+i);
csvfile[i+1,2] := rhs(Sol5[1][1]);
csvfile[i+1,3] := ratioA;
csvfile[i+1,4] := oddsratio;
csvfile[i+1,5] := oddsratioSimUp;
csvfile[i+1,6] := oddsratioSimDown;
csvfile[i+1,7] := 1;

29.95, 0.03355620525, 0.7651906074, 0.6000000000, 0.5294117647,

0.5714285714, 0
-8
29.95, 0.03361194645, 1.750709592 10 , 0.4444444444,

0.5000000000, 0.6000000000, 0
5
29.6, 0.03432592221, 1.013882143 10 , 0.6000000000, 0.4444444444,

0.6923076923, 1
29.55, 0.03447081290, -0.000009845029875, 0.7142857143,

0.6000000000, 0.5000000000, 0
29.8, 0.03403562903, 30660.46200, 0.5294117647, 0.4117647059,

0.7142857143, 0
30.4, 0.03327345914, -0.5761838946, 0.6000000000, 0.5714285714,

0.5294117647, 0
30.3, 0.03376575281, 6.256895964, 0.5000000000, 0.6000000000,

0.5000000000, 0
30.95, 0.03231017771, 0.5328449644, 0.6000000000, 0.6000000000,

0.5000000000, 0
31.1, 0.03104289658, -26.93771895, 0.5000000000, 0.5000000000,

0.6000000000, 0
29.2, 0.03366016138, -0.08555779615, 0.4444444444, 0.5000000000,

0.6000000000, 0
28.95, 0.03415453360, 0.4007940838, 0.6000000000, 0.4444444444,

0.6923076923, 0
28.3, 0.03605364033, 0.00001875789432, 0.3750000000,

0.6000000000, 0.5000000000, 0
28.75, 0.03523629490, 0.9740829247, 0.4117647059, 0.7333333333,

0.3750000000, 1
5
29.2, 0.03415861325, -6.244828641 10 , 0.6000000000,

0.7142857143, 0.4117647059, 1
28.8, 0.03514419367, -0.1430744128, 0.06666666667, 0.6000000000,

0.5000000000, 0
29.4, 0.03352191217, 0.1495513336, 0.5000000000, 1.000000000,

0.06666666667, 0
28.95, 0.03433350933, 2.034565984, 0.5000000000, 0.5000000000,

0.6000000000, 0
28.85, 0.03394117064, 16.52857996, 0.7142857143, 0.5000000000,

0.6000000000, 0
28.5, 0.03419513697, -67.32086106, 0.6000000000, 0.7142857143,

0.4117647059, 0
-8
27.05, 0.03748108008, -3.316856585 10 , 0.6000000000,

0.6000000000, 0.5000000000, 0
27.7, 0.03561234996, 0.9992012832, 0.5000000000, 0.5000000000,

0.6000000000, 1
7
27.25, 0.03636057571, -1.891574002 10 , 0.5000000000,

0.5000000000, 0.6000000000, 1
27.0, 0.03696844993, 1.002386970, 0.03225806452, 0.5000000000,

0.6000000000, 0
-8
26.85, 0.03745201461, -5.221638895 10 , 1.000000000,

0.03225806452, 0, 0
26.85, 0.03734798123, 1.050118943, 0.5000000000, 0.06666666667,

1.000000000, 1

### Animation of two plot sequences of several arrays...

June 23 2014
1 1

Hi everyone

Title might be misleading but couldn't come up with a short version of my problem.

The idea is to show an animation of several plots of an array, which all have different values in the positive and in the negative range. For distinguishing purposes I want to show positive values in a different colour than the negative values.

For better understanding imagine a chess board with the rows and columns and there are places with values, black chess pieces as positive values and white chess pieces as negative values. Each array in the sequence from A1 to An shows a movement.

For the plots I use sparsematrixplot which unfortunately just shows all non-zero values. So I seperated the original array and made two arrays, one with the positive values and one with the negative values. I am able to animate the sequence of several plots and can play the animation of two sequences consecutively with following:

A:=seq(sparsematrixplot(convert(H||g,matrix),color=green,view=[0..10,0..10]),g=1..G):
B:=seq(sparsematrixplot(convert(F||g,matrix),color=red,view=[0..10,0..10]),g=1..G):
display([A,B], insequence=true);

Hence my questions
1. Is it possible to plot an array with different colours for different values and can I animate these plots?

2. If not, is there a way to display the two plot sequences on top of each other?

### Build array of coordinates from implicit equation....

June 06 2014
0 3

Hallo,

Is there a fairly straightforward method for obtaining an array of coordinates from an implicit equation? I have an ellipse defined implicitly (by a horrendously involved expression) and can't figure out how to extract a set of coordinates from an implicitplot. I'm reluctant to use seq and fsolve with a fixed stepsize.

Would be grateful for some insight!

Thanks.

Weirp

### array as a parameter in a procedure...

June 02 2014
0 2

I saw the expression:

proc(a::array(1, mumeric))

the decration of a is array(a, numeric).

But, I can't find still now the expression of array(a, numeric) in HELP in maple.

In the term of array, it is written that it takes as arguments indexfcn, bounds, list.

as in  array( indexfcn, bounds, list).

1 in array(1, mumeric)) is bounds, and probably numeric in array might mean each terms of the array such as (1,2,3)

has to take the property of being numeric. But, it is not written in the term of array in the HELP of Maple.

Where can I find that syntax of array of array(1, numeric)?

taro

### linear system solve ...

May 26 2014
0 0

Hi,

I have a linear system to solve.

mm:=proc(a,x,h,i)
local A,Z1,Z2,Z,F,result;  # to declare the local variable
A:=array(1..2,1..2,[[1,1],[a,a+h]]);
Z1:=evalf(int(1/(abs(y-x)+.000000001),y=a..a+h));
Z2:=evalf(int(y/(abs(y-x)+.000000001),y=a..a+h));
Z:=array([Z1,Z2]);
F:=evalm(inverse(A)&*Z);
result:=F[i]
end:

My questions:

1) My exact Z1 is Z1:=evalf(int(1/(abs(y-x)),y=a..a+h)); but I ask if can I put

Z1:=evalf(int(1/(abs(y-x)+.000000001),y=a..a+h));

the same for Z2.

2) Can I writte in a simple form the vector Z.  Because, later, il have a second system contains Z1,Z2, Z3, Z4,Z5.  The difference between Z1 and Z2 is the variable "y" added in the integral of Z2.

Many thinks.

### reading in a list of data as multiple array/matric...

May 05 2014
1 4

It's been a while since I touched Maple. Just picked it up again to do some stat work, and I'm feeling a bit out of my element having been to accustomed to things like Matl.... (I mean the software that shall not be named).

Is there a way to convert a single array/matrix into multiple arrays?

Scenario:

 1 1 2 7 3 8 4 9 5 10 6 14 7 20

It's easy just to copy and past this as a single element within a worksheet. However, I want to get it so that it's formated like data = [[1,1],[2,7],[3,8],etc...]

Is there a way to reformat into individual elements once everything is in one large array? I'm basically copy and pasting a huge mess of cells from Excel and am looking to see if there's a simplier solution than manual data entry.

### Display Matrix M : Simple question...

April 21 2014
0 3

Hi,

I want to display the matrix M, I used return M, in this procedure, but no matrix M displayed.

restart;
N:=2:
N:=2;
ff:=proc(N)
local M,i,p;
M:=array(1..2*N+1,1..2*N+1):
for i from 1 to 2*N+1 do
for  p from 1  to 2*N+1  do
if p=1 then M[p,i]:=-2;
elif  p=2*N+1  then M[p,i]:=-3;
else
M[p,i]:=0;
end if; end do; end do;
return M;
end proc;

Many thinks

### Null array from command map...

April 08 2014
1 12

Hi All,

I used the command map to apply a procedure to elements of a array like this:

Why did I get the null array "[]"?

A vector was also used and got the similar result:

I'd appreciate any help on this topic. Thank a lot.

### How do I duplicate complex arrays?...

March 26 2014
1 11

Hello,

As a means of encoding information, I'm working with nested array objects (I had originally used lists, but they became too large and Maple suggested that I use arrays). The nesting should be at most four deep, but the nested arrays can have varying lengths. In order to work with the arrays, I have a series of procedures that manipulate a given array and update the existing array object to contain the result. The issue that I have is that one of my procedures needs to simultaneously use both the original array and a modified version of the array, but once the modification is performed, the original version no longer exists.

Ultimately, my issue boils down to this: is there a clean (or messy, I'm not picky) way to duplicate an array so that there are two copies of the array in memory? Just writting Array2 := Array1 just creates another pointer to the same array in memory from what I can tell, so that doesn't work. There is a function copy, but it doesn't seem to work on nested arrays.

For example, running the following does not modify Array2.

Array1 := Array([Array([1, 2]), Array([3, 4])]);
Array2 := Array([Array([1, 2]), Array([5, 6])]);
copy(Array1, Array2);

Indeed, neither does

Array1 := Array([Array([1, 2]), Array([3, 4])]);
Array2 := Array([Array([1, 2]), Array([5, 6])]);
copy(Array1(2), Array2(2));

Unfortunately, the latter case would seem to mean that I can't just write a procedure to recurse through my layers of arrays and copy piecewise either.

Thanks in advance for any help.

### Error with function using Units...

March 25 2014
1 13

Please see the attached worksheet for the error at the end, any idea what happens?

Besides, anyone know how to make plot array with each element has a plot and scatterplot in it?  I made my plot by making table first and then type the cmd individually.

Raw Data

Table 1: Compactability Curve

Table 2: Compressibility Curve

 (1)

 (2)

por1(x);

 (3)

 (4)

Target Weight of Tablet, :

 (5)

Tablet True Density:

 (6)

Width of tablet

 (7)

Length of tablet, l:

 (8)

Cup Depth, h:

 (9)

Cup Volume

 (10)

Die cross sectional area, :

 (11)

Equation to solve tablet thickness using tablet dimension and porocity:

Tablet bulk density:

 (12)

Tablet volume:

 (13)

Tablet bulk Density:

 (14)

 (15)

Function for thickness:

 (16)

 (17)

Tablet tensile strength:

 (18)

Break force of tablet (N)

 (19)

 (20)

 (21)

 (22)

 (23)

 (24)

Encounter problem while chaning variable

BF:=

 (25)

 (26)

but por1 works fine on its own with units

 (27)

plot(evalf(por1(xx)), xx = 10 .. 200);

I also used a lot for for loop in this worksheet, can anyone suggest another way of doing it? And I think I initiated many Array(1..3) that is of no use.  But if I do not initiate and do the following

A[1]:=a :

A[2]:=b:

A[3]:=c:

A;

output: A

Only if I initiate A:=Array(1..3) and then define the element I can see the complete A array at the end.

### printf and print output on the same line...

March 20 2014
0 3

Hi, i'm wondering if theres anything i can do printf and print and have the outputs on the same line. I want the string wihtout any quotations so i think i can only do printf to get this, but then i'm putting an entry out of an array after this. This is a small example out of my code, i would like the output to be all on one line:

The synchronising vector is (S[j-1]) The synchronising word is (X[j-1]) The length of the synchronising word is ...

if (sync=true) then
printf("The Synchronising vector is"); print(S[j-1]);
printf("The sychronising word is");
print(X[j-1]);
printf("The length of the synchronising word is");
print(length(X[j-1]));
else printf("There is no synchronising word");
end if;

At the moment its outputing each print on a new line.

Any help would be much appreciated, thanks.

 1 2 3 4 5 6 7 Last Page 1 of 24
﻿