Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
shrink 3 dimensional array and adjust values logaritmically

Subject: shrink 3 dimensional array and adjust values logaritmically

From: Jonathan W Smith

Date: 12 Sep, 2013 23:14:08

Message: 1 of 4

Hello

Let's say I have an array of size 4 4 4

Let's say I wanted to shrink the matrix to size 4 4 3. Lets say integer values are assigned to each element of the array.

As opposed to just deleting the one row of the 3rd dimension, how can remove a row and adjust the values logarithmically in the remaining three parts of the 3rd dimension?

I think of a function like blockmean(), but it only would adjust the values by finding the means as opposed to logarithmically.

Thanks

Jonathan

Subject: shrink 3 dimensional array and adjust values logaritmically

From: dpb

Date: 12 Sep, 2013 23:52:52

Message: 2 of 4

On 9/12/2013 6:14 PM, Jonathan W Smith wrote:
> Hello
>
> Let's say I have an array of size 4 4 4
>
> Let's say I wanted to shrink the matrix to size 4 4 3. Lets say integer
> values are assigned to each element of the array.
>
> As opposed to just deleting the one row of the 3rd dimension, how can
> remove a row and adjust the values logarithmically in the remaining
> three parts of the 3rd dimension?
> I think of a function like blockmean(), but it only would adjust the
> values by finding the means as opposed to logarithmically.

The 3rd dimension you'd remove would be a plane, wouldn't it?

How do you want to set the limits the original limits of first/last
plane values or those remaining after the deletion first?

I posted an example of interp1() for logarithmic interpolation just a
day or two ago at most--same idea'll work here. It was on the Answers
forum though so here...for the two vectors in y(1:2,:) for that poster
and the midpoint of 15 between the two values of 15:25 for independent
variables...

10.^(interp1([5 25]',log10(y),15))

--

Subject: shrink 3 dimensional array and adjust values logaritmically

From: Jonathan W Smith

Date: 13 Sep, 2013 13:44:09

Message: 3 of 4

dpb <none@non.net> wrote in message <l0tk58$lff$1@speranza.aioe.org>...
> On 9/12/2013 6:14 PM, Jonathan W Smith wrote:
> > Hello
> >
> > Let's say I have an array of size 4 4 4
> >
> > Let's say I wanted to shrink the matrix to size 4 4 3. Lets say integer
> > values are assigned to each element of the array.
> >
> > As opposed to just deleting the one row of the 3rd dimension, how can
> > remove a row and adjust the values logarithmically in the remaining
> > three parts of the 3rd dimension?
> > I think of a function like blockmean(), but it only would adjust the
> > values by finding the means as opposed to logarithmically.
>
> The 3rd dimension you'd remove would be a plane, wouldn't it?
>
> How do you want to set the limits the original limits of first/last
> plane values or those remaining after the deletion first?
>
> I posted an example of interp1() for logarithmic interpolation just a
> day or two ago at most--same idea'll work here. It was on the Answers
> forum though so here...for the two vectors in y(1:2,:) for that poster
> and the midpoint of 15 between the two values of 15:25 for independent
> variables...
>
> 10.^(interp1([5 25]',log10(y),15))
>
> --
>
Thanks. The dimension I remove would be a plane. The first/last remain after the plane is removed. Does this effect the interpolation above? Thanks

Subject: shrink 3 dimensional array and adjust values logaritmically

From: dpb

Date: 13 Sep, 2013 14:08:27

Message: 4 of 4

On 9/13/2013 8:44 AM, Jonathan W Smith wrote:
> dpb <none@non.net> wrote in message <l0tk58$lff$1@speranza.aioe.org>...
>> On 9/12/2013 6:14 PM, Jonathan W Smith wrote:
>> > Hello
>> >
>> > Let's say I have an array of size 4 4 4
>> >
>> > Let's say I wanted to shrink the matrix to size 4 4 3. Lets say integer
>> > values are assigned to each element of the array.
>> >
>> > As opposed to just deleting the one row of the 3rd dimension, how can
>> > remove a row and adjust the values logarithmically in the remaining
>> > three parts of the 3rd dimension?
>> > I think of a function like blockmean(), but it only would adjust the
>> > values by finding the means as opposed to logarithmically.
>>
>> The 3rd dimension you'd remove would be a plane, wouldn't it?
>>
>> How do you want to set the limits the original limits of first/last
>> plane values or those remaining after the deletion first?
>>
>> I posted an example of interp1() for logarithmic interpolation just a
>> day or two ago at most--same idea'll work here. It was on the Answers
>> forum though so here...for the two vectors in y(1:2,:) for that poster
>> and the midpoint of 15 between the two values of 15:25 for independent
>> variables...
>>
>> 10.^(interp1([5 25]',log10(y),15))
>>
>> --
>>
> Thanks. The dimension I remove would be a plane. The first/last remain
> after the plane is removed. Does this effect the interpolation above?
> Thanks

No, it only determines what you use for the X,Y values in the argument
list -- the initial values or those remaining.

For the plane it is probably simpler to use arrayfun() on logspace() as
the operating function than to propagate the interp1 output across the
grid -- the above would be a single row.

--

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us