2 variables in single cell

a=[1
4,5
7 ]
(1*3 matrix)
B=[1
10
12,14]
(1*3 matrix)
i have a print the max of a and b??

6 件のコメント

James Tursa
James Tursa 2019 年 9 月 21 日
Please clarify what you really have and what you want as a result, because what you have written isn't valid MATLAB syntax.
dinesh kumar mohan
dinesh kumar mohan 2019 年 9 月 21 日
To be clear.. I have an excel file, in which I have activities A, B, C, D in first column.. in second column I have duration for each activity as 3,4,5,6.. 3rd column which says each activity depend on other activities for example activity C depends on A,B.. I have to print the result for C as maximum of duration of A and B.. I have 50-60 activities..
dinesh kumar mohan
dinesh kumar mohan 2019 年 9 月 21 日
So for activity C. Result will be 4 because 4 of activity B is higher than activity A
madhan ravi
madhan ravi 2019 年 9 月 21 日
Why not upload the file?
dinesh kumar mohan
dinesh kumar mohan 2019 年 9 月 21 日
from the attchemendt i have to read theexcel and find the critical path and start and finish of each activity.
Guillaume
Guillaume 2019 年 9 月 21 日
How is what you're now asking in any way related to your original question?

サインインしてコメントする。

回答 (1 件)

Dheeraj Singh
Dheeraj Singh 2019 年 10 月 3 日

0 投票

You can try the following approach:
First you can make cell for all processes and populate it with duration of all processes it depends on.
The cell array may look like:
s=cell(7,1);
s{1}=[];%duration 2
s{2}=[];%duration 1
s{3}=[];%duration 3
s{4}=[2 1];%depends on 1 and 2
s{5}=[1 3];%depends on 2 and 3
s{6}=[3];%depends on 3
s{7}=[s{4} s{5} s{6}]%depends on 4,5,6
After getting all the duration populated, we can get the maximum for each column in the following manner:
t=cellfun(@max,s,'UniformOutput',false)
The empty cells mean the process is not dependent on any other process.

カテゴリ

ヘルプ センター および File ExchangeGet Started with MATLAB についてさらに検索

質問済み:

2019 年 9 月 21 日

回答済み:

2019 年 10 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by