COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

Problem dividing two vectors

• Follow

```Hi,

I am working on a solution of following problem:

I will get two values of two different resistances, say R1 and R2 from another programm.

For this 2 resistances, I have to look for an actual existing value from 4 different given series, which I have stored in a xls file.

The first thing I want to do is compare the resistance with the values in the xls file.

I tought the easiest way to do it was to divide the value of the given resistance with the value of the resistance which we are looking for, in this way:

(Rnorm/R1 -1)^2

Rnorm represents the value of the resistance in the xls file.

This is so far my programm:

function [ Rnormiert ] = Widerstaende( input_args )
%Widerstaende Summary of this function goes here
%   Detailed explanation goes here
R12=NUMERIC(:,1)
R24=NUMERIC(:,2);
R48=NUMERIC(:,3);
R96=NUMERIC(:,4);

i = 1;
Rnormiert = 0;
R = zeros(643,1) +1;
%später muss R variable sein
R12neu=R/R12

and when I run it I get following error:

??? Undefined function or method 'mrdivide' for input
arguments of type 'cell'.

Error in ==> Widerstaende at 14
R12neu=R/R12

Could anyone please help me? I gess it has something to do with the kind of data I'm dividing, but like I said, I'm a beginner at Matlab.

Thanks!

Patrick
```
 0
Reply Patrick 12/15/2010 9:57:04 AM

```On Dec 15, 1:57=A0am, "Patrick Schmitt"
> Hi,
>
> I am working on a solution of following problem:
>
> I will get two values of two different resistances, say R1 and R2 from an=
other programm.
>
> For this 2 resistances, I have to look for an actual existing value from =
4 different given series, which I have stored in a xls file.
>
> The first thing I want to do is compare the resistance with the values in=
the xls file.
>
> I tought the easiest way to do it was to divide the value of the given re=
sistance with the value of the resistance which we are looking for, in this=
way:
>
> (Rnorm/R1 -1)^2
>
> Rnorm represents the value of the resistance in the xls file.
>
> This is so far my programm:
>
> function [ Rnormiert ] =3D Widerstaende( input_args )
> %Widerstaende Summary of this function goes here
> % =A0 Detailed explanation goes here
> R12=3DNUMERIC(:,1)
> R24=3DNUMERIC(:,2);
> R48=3DNUMERIC(:,3);
> R96=3DNUMERIC(:,4);
>
> i =3D 1;
> Rnormiert =3D 0;
> R =3D zeros(643,1) +1;
> %sp=E4ter muss R variable sein
> R12neu=3DR/R12
>
> and when I run it I get following error:
>
> ??? Undefined function or method 'mrdivide' for input
> arguments of type 'cell'.
>
> Error in =3D=3D> Widerstaende at 14
> R12neu=3DR/R12
>
> Could anyone please help me? I gess it has something to do with the kind =
of data I'm dividing, but like I said, I'm a beginner at Matlab.
>
> Thanks!
>
> Patrick

to 'divide' 2 vectors, you can use   A ./ B  (i.e. element by element
division).

--Nasser
```
 0
Reply Nasser 12/15/2010 10:23:39 AM

1 Replies
674 Views

(page loaded in 0.236 seconds)

Similiar Articles:

7/25/2012 1:08:38 PM