Borrar filtros
Borrar filtros

insert values of one table into another table if 1

4 visualizaciones (últimos 30 días)
Hi, i have a question. Hopefully someone can help.
I have the attached tables with different size. One of them is a logical.
I want a new table:
if the logical table is 1 i want the first value of the second table
if the logical table is 0 i want 0
f.e.
Table 1 Table 2 new table
1 547 547
0 59 0
0 439 0
1 20 59
Thanks for your help

Respuesta aceptada

Walter Roberson
Walter Roberson el 1 de Ag. de 2022
temp(table1{:,1}) = table2{:, 1};
Then array2table(temp) and provide the appropriate variable name
  1 comentario
Frederik Reese
Frederik Reese el 2 de Ag. de 2022
Hi,
when I run this, I get not the correct solution.
My logical is 4585x1, the corresponding double is 852x1 and the solution is 1x4583.
Can you tell me why the solution is too short and why the value assignment is at some points incorrct?
DauertRmax10000new(Lv(:,1)) = DauerTRmax10000(:, 1);
Unrecognized function or variable 'DauerTRmax10000'.
Thanks in advance.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Tables en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by