- 博客(8)
- 收藏
- 关注
原创 今日练习cody之分享
Problem 5. Triangle Numbers function t = triangle(n) t=0; for i=1:n t=t+i; end end Problem 1035. Generate a vector like 1,2,2,3,3,3,4,4,4,4 function ans = your_fcn_name(x) ans=[]; for i=1:x b=repmat(i,1,i); ans=[ans b]; end end Proble
2022-04-18 20:40:36
376
原创 今日cody之练习
Problem 1451. Symmetry of vector function y = symmetry(x) n=length(x); for i=1:n if x(i)==x(n-i+1) y=1; else y=0; end end end Problem 1430. Create an n-by-n null matrix and fill with ones certain posi
2022-04-15 14:37:36
423
原创 今日学习之matlab
Problem 2020. Area of an Isoceles Triangle function A = isocelesArea(x,y) a=sqrt(1-(y/(2*x))^2) A = 0.5*x*y*a end Problem 2023. Is this triangle right-angled? function flag = isRightAngled(a,b,c) x=[a b c]; y=sort(x); a=y(1);b=y(2);c=y(3); if any(a^
2022-04-14 19:45:41
245
原创 继续学习matlab
Problem 2867. Matlab Basics - Rounding III function y = round_ten_thou(x) y =round(x,-4) ; end Problem 2866. Matlab Basics - Rounding II function y = round_3_d_p(x) y =round(x,3) ; end Problem 2559. Check that number is whole number function y
2022-04-11 18:40:30
244
原创 坚持学习matlab,虽然自己的编程能力很低,但是我还是要继续学
Problem 43294. Can we make a triangle? function flag = Is_Triangle(a, b, c) if a+b>c&&a+c>b&&b+c>a flag=true; else flag=false; end end Problem 43599. Find the sides of an isosceles triangle when given its area and height
2022-04-10 19:58:21
545
原创 【无标题】cody分享,希望自己能坚持分享,坚持学习matlab
Problem 2869. There are 10 types of people in the world function y = yearraey(x) x=dec2bin(x); y=0; while 1 ret = 1; for i=1:length(x)/2 if (x(i)~=x(end-i+1)) ret=0; break; en
2022-04-09 20:58:17
354
原创 【无标题】cody练习分享
Problem 1971. Remove element(s) from cell array function y = remove_from_cell_array(x,to_remove) x(to_remove)=[]; y = x; end Problem 1899. Convert a Cell Array into an Array function y = your_fcn_name(x) y=[x{:}]; end Problem 967. Split a string i..
2022-04-09 20:34:35
377
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅