How to remove invalid left hand side of assignment, invalid "=" usage might be invalid matlab syntax and invalid character(s) in my code? Because this is my final project so i need to submit this. Really need help please.my algorithm also attached.

35 ビュー (過去 30 日間)
Seeking help. how to remove errors in code?
please help me to solve this. thanks in advance
Mobile device set: \mathcal {N}=\{1,2,\cdots,N\};
Transmission prower to MBS: \{p_{i}^{M}},i \in\mathcal{N};
Transmission prower to SBS: \{p_{i}^{S}},i \in\mathcal{N};
Computation tasks: T_{i}=\{d_{i},c_{i},t_{i}^{max}}, i\in\mathcal{N};
Categorized device sets: \mathcal{G}_{L}=\mathcal{G}_{O}=\mathcal{G}_{R}=\ emptyset;
for (i\in\mathcal{N})
t_{i}^{L}=c_{i}/f_{i}^{L}; %local time
e_{i}^{L}=c_{i}\delta_{i}^{L}; % local energy consumption
if (t_{i}^{L} > t_{i}^{max})
i\Rightarrow \mathcal{G}_{R};
elseif (t_{i}^{L} <= t_{i}^{max})
if (e_{i}^{L}< min\{p_{i}^{M}\left\lceil{n_{o}^{M}}\right \rceil ,p_{i}^{S}\left\lceil{n_{o}^{S}}}\right\rceil\ + c_{i}\delta^{R})
i\Rightarrow \mathcal {G}_{L};
end
else
i\Rightarrow \ mathcal {G}_{O};
end
end
  1. Error: File: first_algorithm1st.m Line: 6 Column:
Invalid use of operator.
2.Error: File: first_algorithm1st.m Line: 7 Column: 10
parse error at "=": usage might be invalid
3..Error: File: first_algorithm1st.m Line: 8 Column: 10
parse error at "=": usage might be invalid
4.line : 10,13,16 shows invalid character(s)
  1 件のコメント
Guillaume
Guillaume 2019 年 5 月 16 日
Note that I've removed the tag attached to this post. Offers of payment are not allowed on this forum.

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

採用された回答

Walter Roberson
Walter Roberson 2019 年 5 月 16 日
With a whole bunch of speculation as to what the notation means:
Mobile_device_set = 1..N;
Transmission_prower_to_MBS = p_(1:N, M):
Transmission_prower_to_SBS = p_(1:N, S);
for i = 1 : N
Computation_tasks_T_{i} = {d_(i), c_(i), t_(i,max)};
end
Categorized_device_sets_G_L = [];
Categorized_device_sets_G_O = [];
Categorized_device_sets_G_R = [];
for i = 1 : N
t_(i,L) = c_(i) ./ f_(i,L); %local time
e_(i,L) = c_(i) .* delta_(i,L); % local energy consumption
if t_(i,L) > t_(i,max)
Categorized_device_sets_G_R = union(Categorized_device_sets_G_R, i);
elseif t_(i,L) <= t_(i,max)
if (e_(i,L) < min\{p_{i}^{M}\left\lceil{n_{o}^{M}}\right \rceil ,p_{i}^{S}\left\lceil{n_{o}^{S}}}\right\rceil\ + c_{i}\delta^{R}) %I could not figure out how to translate this line
Categorized_device_sets_G_L = union(Categorized_device_sets_G_L, i);
end
else
Categorized_device_sets_G_O = union(Categorized_device_sets_G_O, i);
end
end
Parts of this make no sense. For example the only time i\Rightarrow \ mathcal {G}_{O}; can be encountered is if some variables are NaN, since NaN is the only case on the reals where (A>B) and (A<=B) can both be false.
  1 件のコメント
Hamza  Pervaiz
Hamza Pervaiz 2019 年 5 月 16 日
thank you so much Sir i realy realy thank full to you for your time and help.

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

その他の回答 (1 件)

Geoff Hayes
Geoff Hayes 2019 年 5 月 15 日
Hamza - has your code been formatted for LaTeX? Is that why there are references to mathcal? What is N supposed to be defined as? An array of some kind?
The errors seem to be related to your formatting so please remove the LaTeX references so that you have MATLAB code only.
  4 件のコメント
Hamza  Pervaiz
Hamza Pervaiz 2019 年 5 月 16 日
thank you Sir . you are a great person. Thanks again for your time and help.
Titus Edelhofer
Titus Edelhofer 2019 年 5 月 17 日
Dear Hamza, if you are requested to implement your algorithm in MATLAB for your degree then you probably have to learn some basics of MATLAB. Take a look at the Getting Started chapter (or the video on the right hand side of the website). Try to implement the algorithm and come back to this forum to ask for specific help.
Best Regards,
Titus

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

カテゴリ

Help Center および File ExchangeParallel Computing についてさらに検索

タグ

タグが未入力です。

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by