Error using plot vectors must be the same length матлаб

Error using plot Matlab Решение и ответ на вопрос 1468057

newbie99

0 / 0 / 0

Регистрация: 04.06.2015

Сообщений: 7

1

04.06.2015, 08:51. Показов 4721. Ответов 3

Метки нет (Все метки)


были различные ошибки, но смог их исправить, но с этой встал в ступор и не могу понять как быть

Matlab M
1
2
3
 u = 1.25:0.4:3.25;
y = ((abs(x.*x-2.5)).^(1/4))+((log10(x.*x)).^(1/3));
plot(u,y);

Error using plot
Vectors must be the same length.
если разбивать функцию на части, то ошибка не пропадает, значит надо изменить формат записи функции?

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



Programming

Эксперт

94731 / 64177 / 26122

Регистрация: 12.04.2006

Сообщений: 116,782

04.06.2015, 08:51

3

Эксперт по математике/физике

3368 / 1893 / 569

Регистрация: 09.04.2015

Сообщений: 5,297

04.06.2015, 09:09

2

Лучший ответ Сообщение было отмечено newbie99 как решение

Решение

В строке 2 переменная x, она во фрагменте не задана.
Усли х это u, то график строится даже с очень мелким шагом.
В точке х=0 функция имеет особую точку, т.к log10(0)= -бесконечности
А в диапазоне -1<x<1 y комплексное.
Но Вашей ошибки не получилось.



0



newbie99

0 / 0 / 0

Регистрация: 04.06.2015

Сообщений: 7

04.06.2015, 09:28

 [ТС]

3

спасибо, подтолкнули в нужную сторону, исправил и заработало

Добавлено через 4 минуты
с plot работает нормально но с fplot стал писать Too many input arguments.

Matlab M
1
2
3
4
5
6
7
>> f=@(x)((abs(x.*x-2.5)).^(1/4))+((log10(x.*x)).^(1/3));
fplot(f,[0,20],[],[],'-',1.84);
hold on
fplot(f,[0,20],[],[],'~',2.71);
fplot(f,[0,20],[],[],'::',3.81);
fplot(f,[0,20],[],[],':',4.56);
fplot(f,[0,20],[],[],'--',5.62);

не одно, так другое т_т



0



Эксперт по математике/физике

3368 / 1893 / 569

Регистрация: 09.04.2015

Сообщений: 5,297

04.06.2015, 11:31

4

Разберись с параметрами fplot, что там за пустые скобки?



0



IT_Exp

Эксперт

87844 / 49110 / 22898

Регистрация: 17.06.2006

Сообщений: 92,604

04.06.2015, 11:31

4

Содержание

  1. Error using plot Vectors must be the same length.
  2. Direct link to this question
  3. Direct link to this question
  4. Answers (1)
  5. Direct link to this answer
  6. Direct link to this answer
  7. See Also
  8. Categories
  9. Community Treasure Hunt
  10. How to Get Best Site Performance
  11. Americas
  12. Europe
  13. Asia Pacific
  14. Error using plot3 Vectors must be the same length.
  15. Direct link to this question
  16. Direct link to this question
  17. Direct link to this comment
  18. Direct link to this comment
  19. Answers (1)
  20. Direct link to this answer
  21. Direct link to this answer
  22. See Also
  23. Categories
  24. Community Treasure Hunt
  25. How to Get Best Site Performance
  26. Americas
  27. Europe
  28. Asia Pacific
  29. Error using plot Vectors must be the same length.
  30. Direct link to this question
  31. Direct link to this question
  32. Direct link to this comment
  33. Direct link to this comment
  34. Answers (1)
  35. Direct link to this answer
  36. Direct link to this answer
  37. See Also
  38. Categories
  39. Products
  40. Community Treasure Hunt
  41. How to Get Best Site Performance
  42. Americas
  43. Europe
  44. Asia Pacific
  45. Error using plot Vectors must be the same length.
  46. Direct link to this question
  47. Direct link to this question
  48. Accepted Answer
  49. Direct link to this answer
  50. Direct link to this answer
  51. Direct link to this comment
  52. Direct link to this comment
  53. More Answers (0)
  54. See Also
  55. Categories
  56. Community Treasure Hunt
  57. How to Get Best Site Performance
  58. Americas
  59. Europe
  60. Asia Pacific
  61. Error using plot3 — Vectors must be the same length
  62. Direct link to this question
  63. Direct link to this question
  64. Accepted Answer
  65. Direct link to this answer
  66. Direct link to this answer
  67. More Answers (0)
  68. See Also
  69. Categories
  70. Products
  71. Release
  72. Community Treasure Hunt
  73. How to Get Best Site Performance
  74. Americas
  75. Europe
  76. Asia Pacific

Error using plot Vectors must be the same length.

Direct link to this question

Direct link to this question

0 Comments

Answers (1)

Direct link to this answer

Direct link to this answer

0 Comments

See Also

Categories

Community Treasure Hunt

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

An Error Occurred

Unable to complete the action because of changes made to the page. Reload the page to see its updated state.

Select a Web Site

Читайте также:  No proposal chosen notify error

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文 Chinese
    • English
  • 日本 Japanese (日本語)
  • 한국 Korean (한국어)

Accelerating the pace of engineering and science

MathWorks is the leading developer of mathematical computing software for engineers and scientists.

Источник

Error using plot3 Vectors must be the same length.

Direct link to this question

Direct link to this question

1 Comment

Direct link to this comment

Direct link to this comment

Answers (1)

Direct link to this answer

Direct link to this answer

0 Comments

See Also

Categories

Community Treasure Hunt

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

An Error Occurred

Unable to complete the action because of changes made to the page. Reload the page to see its updated state.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文 Chinese
    • English
  • 日本 Japanese (日本語)
  • 한국 Korean (한국어)

Accelerating the pace of engineering and science

Читайте также:  Digma dicam 145 прошивка

MathWorks is the leading developer of mathematical computing software for engineers and scientists.

Источник

Error using plot Vectors must be the same length.

Direct link to this question

Direct link to this question

1 Comment

Direct link to this comment

Direct link to this comment

Answers (1)

Direct link to this answer

Direct link to this answer

0 Comments

See Also

Categories

Products

Community Treasure Hunt

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

An Error Occurred

Unable to complete the action because of changes made to the page. Reload the page to see its updated state.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文 Chinese
    • English
  • 日本 Japanese (日本語)
  • 한국 Korean (한국어)

Accelerating the pace of engineering and science

MathWorks is the leading developer of mathematical computing software for engineers and scientists.

Источник

Error using plot Vectors must be the same length.

Direct link to this question

Direct link to this question

0 Comments

Accepted Answer

Direct link to this answer

Direct link to this answer

1 Comment

Direct link to this comment

Direct link to this comment

More Answers (0)

See Also

Categories

Community Treasure Hunt

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

An Error Occurred

Unable to complete the action because of changes made to the page. Reload the page to see its updated state.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

Читайте также:  Error ioctl no such device

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文 Chinese
    • English
  • 日本 Japanese (日本語)
  • 한국 Korean (한국어)

Accelerating the pace of engineering and science

MathWorks is the leading developer of mathematical computing software for engineers and scientists.

Источник

Error using plot3 — Vectors must be the same length

Direct link to this question

Direct link to this question

0 Comments

Accepted Answer

Direct link to this answer

Direct link to this answer

0 Comments

More Answers (0)

See Also

Categories

Products

Release

Community Treasure Hunt

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

An Error Occurred

Unable to complete the action because of changes made to the page. Reload the page to see its updated state.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文 Chinese
    • English
  • 日本 Japanese (日本語)
  • 한국 Korean (한국어)

Accelerating the pace of engineering and science

MathWorks is the leading developer of mathematical computing software for engineers and scientists.

Источник

plot Vectors must be the same lengths

Here is my code

I want to have a figure that the X label is i, the Y label is v and we can see change of V in different Temperature (T). but I face the error that «plot Vectors must be the same lengths.»

How can I fix this error?

2 Answers 2

Check dimension of your x, y vector by using size(i) size(V) . i should be a vector and the size should be [1 Len] or [Len 1]. Make sure the size of V is [Len, xxx] or [xxx, Len] too, so they are in the same length and you can plot it. Also, make sure i, and V have the same length ‘Len’ in the same dimension, otherwise you can use dot quotation operator, V.’ , to get the transpose.

As Steven mentioned, you have a dimensional mismatch. Getting more familiar with a couple of the Matlab array operators (: and .) explained in the code can shorten and clarify the code.

Housekeeping before we get started:

Declare all your variables:

use T as a 1×4 and do that stuff first all of these will be 1×4 afterwards T=333:10:363; Notice the use of the dot operator to do pointwise operations

Now let’s do all the parts that involve i. Let’s not start at i=0 because that gives Nan/Inf results i=0.01:0.01:1;

If you wanted to, you could do this with section using matrix multiplication. It’s implemented here with a for loop because that is easier to follow.

In the V=(idx,:) line we are taking the 101×1 vector and shoving it into the idx row of V using the colon operator.

Источник

Error using plot3 Vectors must be the same length.

Direct link to this question

Direct link to this question

1 Comment

Direct link to this comment

Direct link to this comment

Answers (1)

Direct link to this answer

Direct link to this answer

0 Comments

See Also

Categories

Community Treasure Hunt

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

An Error Occurred

Unable to complete the action because of changes made to the page. Reload the page to see its updated state.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文 Chinese
    • English
  • 日本 Japanese (日本語)
  • 한국 Korean (한국어)

Accelerating the pace of engineering and science

MathWorks is the leading developer of mathematical computing software for engineers and scientists.

Источник

Error using plot3 — Vectors must be the same lengths.

Direct link to this question

Direct link to this question

0 Comments

Answers (1)

Direct link to this answer

Direct link to this answer

1 Comment

Direct link to this comment

Direct link to this comment

See Also

Categories

Community Treasure Hunt

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

An Error Occurred

Unable to complete the action because of changes made to the page. Reload the page to see its updated state.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文 Chinese
    • English
  • 日本 Japanese (日本語)
  • 한국 Korean (한국어)

Accelerating the pace of engineering and science

MathWorks is the leading developer of mathematical computing software for engineers and scientists.

Источник

Error using plot Vectors must be the same length.

Direct link to this question

Direct link to this question

0 Comments

Answers (1)

Direct link to this answer

Direct link to this answer

2 Comments

Direct link to this comment

Direct link to this comment

Direct link to this comment

Direct link to this comment

,ixOrder]=sort(Radius(index_liq)); % get the sorted order of radius values

See Also

Categories

Community Treasure Hunt

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

An Error Occurred

Unable to complete the action because of changes made to the page. Reload the page to see its updated state.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文 Chinese
    • English
  • 日本 Japanese (日本語)
  • 한국 Korean (한국어)

Accelerating the pace of engineering and science

MathWorks is the leading developer of mathematical computing software for engineers and scientists.

Источник

Error using plot3 Vectors must be the same length.

Direct link to this question

Direct link to this question

1 Comment

Direct link to this comment

Direct link to this comment

Answers (1)

Direct link to this answer

Direct link to this answer

0 Comments

See Also

Categories

Community Treasure Hunt

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

An Error Occurred

Unable to complete the action because of changes made to the page. Reload the page to see its updated state.

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

Americas

Europe

  • Belgium (English)
  • Denmark (English)
  • Deutschland (Deutsch)
  • España (Español)
  • Finland (English)
  • France (Français)
  • Ireland (English)
  • Italia (Italiano)
  • Luxembourg (English)
  • Netherlands (English)
  • Norway (English)
  • Österreich (Deutsch)
  • Portugal (English)
  • Sweden (English)
  • Switzerland
    • Deutsch
    • English
    • Français
  • United Kingdom (English)

Asia Pacific

  • Australia (English)
  • India (English)
  • New Zealand (English)
  • 中国
    • 简体中文 Chinese
    • English
  • 日本 Japanese (日本語)
  • 한국 Korean (한국어)

Accelerating the pace of engineering and science

MathWorks is the leading developer of mathematical computing software for engineers and scientists.

Источник

Понравилась статья? Поделить с друзьями:
  • Error using mrdivide
  • Error using mpower inputs must be a scalar and a square matrix
  • Error using mesh line 71 data dimensions must agree
  • Error using matrix dimensions must agree matlab
  • Error using loadlibrary matlab