Slavador 3 / 3 / 0 Регистрация: 26.09.2014 Сообщений: 84 |
||||
1 |
||||
13.09.2015, 11:46. Показов 7504. Ответов 5 Метки нет (Все метки)
Последняя строка выдает ошибку
Добавлено через 18 минут
__________________
0 |
Programming Эксперт 94731 / 64177 / 26122 Регистрация: 12.04.2006 Сообщений: 116,782 |
13.09.2015, 11:46 |
5 |
Krasme 6513 / 4646 / 1932 Регистрация: 02.02.2014 Сообщений: 12,478 |
||||
13.09.2015, 11:57 |
2 |
|||
СЕКРЕТНО! Зловещая точка претыкания Добавлено через 6 минут
1 |
3 / 3 / 0 Регистрация: 26.09.2014 Сообщений: 84 |
|
13.09.2015, 12:01 [ТС] |
3 |
Еще нужно где-то перед делением ставить, а то все 50 ответов одинаковые. И если не сложно, можешь объяснить логику, как ты определил перед какими именно возведениями ставить «.»?
0 |
Krasme 6513 / 4646 / 1932 Регистрация: 02.02.2014 Сообщений: 12,478 |
||||||||||||||||
13.09.2015, 12:08 |
4 |
|||||||||||||||
как ты определил перед какими именно возведениями ставить как новичку, рекомендую поступать поэтапно…
затем
и напоследок
разобравшись с каждым этапом, определитесь с точками
1 |
3 / 3 / 0 Регистрация: 26.09.2014 Сообщений: 84 |
|
13.09.2015, 12:34 [ТС] |
5 |
Методом тыка то получается, просто интересно какой логикой нужно руководствоваться, чтобы сразу понимать, где ставить
0 |
6513 / 4646 / 1932 Регистрация: 02.02.2014 Сообщений: 12,478 |
|
13.09.2015, 12:41 |
6 |
0 |
-
Roman5000
- Пользователь
- Сообщения: 13
- Зарегистрирован: Сб окт 04, 2008 4:43 pm
График
Здраствуйте. Не выходит построить график функции. Я записываю так
>> x=5:0.1:25;
>> y=(((log(x))^2)-5*log(x)+6);
??? Error using ==> mpower
Matrix must be square.
-
Roman5000
- Пользователь
- Сообщения: 13
- Зарегистрирован: Сб окт 04, 2008 4:43 pm
Сообщение Roman5000 » Сб окт 04, 2008 5:05 pm
А если вести логарифм в степени 2 просто как умножить два раза то выдает другую ошибку
>> x=5:1:25;
>> y=(log(x)*log(x)-5*log(x)+6);
??? Error using ==> mtimes
Inner matrix dimensions must agree.
-
sandy
- Эксперт
- Сообщения: 5601
- Зарегистрирован: Ср сен 22, 2004 4:49 pm
Сообщение sandy » Сб окт 04, 2008 5:07 pm
Операции должны быть поэлементными, а не векторными:
y=(log(x).*log(x)-5*log(x)+6);
С уважением
Александр Сергиенко
-
Roman5000
- Пользователь
- Сообщения: 13
- Зарегистрирован: Сб окт 04, 2008 4:43 pm
Сообщение Roman5000 » Сб окт 04, 2008 5:11 pm
Спасибо а что это значит? как это задается? тоесть вы просто поставили точку после логарифма ?
-
Roman5000
- Пользователь
- Сообщения: 13
- Зарегистрирован: Сб окт 04, 2008 4:43 pm
Сообщение Roman5000 » Сб окт 04, 2008 11:49 pm
Еще такой вопрос — меняю парметры Х, а график от этого не меняется, тоесть к примеру
x=-10:1:10; или x=-100:1:100; а выводит график от 0 до 250 в любом случае…. как это можно изменить?
-
Di@blo
- Пользователь
- Сообщения: 115
- Зарегистрирован: Вт мар 04, 2008 8:34 am
Сообщение Di@blo » Вс окт 05, 2008 6:18 am
Roman5000 писал(а):Еще такой вопрос — меняю парметры Х, а график от этого не меняется, тоесть к примеру
x=-10:1:10; или x=-100:1:100; а выводит график от 0 до 250 в любом случае…. как это можно изменить?
А игрик пересчитвешь? или просто пишешь
x=-10:1:10;
plot(y);
??
____________________
…изобретает, не тот, кто знает, что это не возможно, а тот, кто этого не знает…
ICQ 438225453
-
Roman5000
- Пользователь
- Сообщения: 13
- Зарегистрирован: Сб окт 04, 2008 4:43 pm
Сообщение Roman5000 » Вс окт 05, 2008 12:27 pm
да, просто пишу плот у
-
Di@blo
- Пользователь
- Сообщения: 115
- Зарегистрирован: Вт мар 04, 2008 8:34 am
Сообщение Di@blo » Вс окт 05, 2008 1:14 pm
Roman5000 писал(а):да, просто пишу плот у
напиши так
x=-10:.1:10;
y=(log(x).*log(x)-5*log(x)+6);
plot(y);
у меня работает)
____________________
…изобретает, не тот, кто знает, что это не возможно, а тот, кто этого не знает…
ICQ 438225453
-
Ромашка
- Пользователь
- Сообщения: 2
- Зарегистрирован: Пт май 14, 2010 9:05 pm
Сообщение Ромашка » Пт май 14, 2010 9:17 pm
у меня похожая проблема
я имею функцию f(t)=G(1,1)*(t^2)+G(2,1)*t+G(3,1);
и мену тоже выдаёт Error using ==> mpower
Matrix must be square..
-
Jey
- Пользователь
- Сообщения: 2714
- Зарегистрирован: Вт сен 12, 2006 2:21 pm
Сообщение Jey » Пт май 14, 2010 9:26 pm
Код: Выделить всё
t=1:5;
G=ones(3,1);
f=G(1,1)*(t.^2)+G(2,1)*t+G(3,1);
-
Ромашка
- Пользователь
- Сообщения: 2
- Зарегистрирован: Пт май 14, 2010 9:05 pm
Сообщение Ромашка » Пт май 14, 2010 9:59 pm
Jey писал(а):
Код: Выделить всё
t=1:5;
G=ones(3,1);
f=G(1,1)*(t.^2)+G(2,1)*t+G(3,1);
спасибо я понял свою ошибку
помог!
-
aliis
- Пользователь
- Сообщения: 1
- Зарегистрирован: Пт апр 20, 2012 3:06 am
Сообщение aliis » Пт апр 20, 2012 3:09 am
Возникла проблема
>> y=2^(2*cos(x)-x.^2)+sin(pi/2-x)-x.^2;
??? Error using ==> mpower
Inputs must be a scalar and a square matrix.
Не могу понять ошибку.
-
abobroff
- Пользователь
- Сообщения: 488
- Зарегистрирован: Пн окт 25, 2010 1:21 pm
Сообщение abobroff » Пт апр 20, 2012 7:16 am
aliis писал(а):Возникла проблема
>> y=2^(2*cos(x)-x.^2)+sin(pi/2-x)-x.^2;
??? Error using ==> mpower
Inputs must be a scalar and a square matrix.
Содержание
- Why do I get the error message ‘Matrix must be square.’ ?
- Direct link to this question
- Direct link to this question
- Accepted Answer
- Direct link to this answer
- Direct link to this answer
- Direct link to this comment
- Direct link to this comment
- Direct link to this comment
- Direct link to this comment
- More Answers (0)
- See Also
- Categories
- Products
- Community Treasure Hunt
- How to Get Best Site Performance
- Americas
- Europe
- Asia Pacific
- Matrix must be square error.
- Direct link to this question
- Direct link to this question
- Direct link to this comment
- Direct link to this comment
- Answers (1)
- Direct link to this answer
- Direct link to this answer
- See Also
- Categories
- Community Treasure Hunt
- How to Get Best Site Performance
- Americas
- Europe
- Asia Pacific
- Why do I get the error message ‘Matrix must be square.’ ?
- Direct link to this question
- Direct link to this question
- Accepted Answer
- Direct link to this answer
- Direct link to this answer
- Direct link to this comment
- Direct link to this comment
- Direct link to this comment
- Direct link to this comment
- More Answers (0)
- See Also
- Categories
- Products
- Community Treasure Hunt
- How to Get Best Site Performance
- Americas
- Europe
- Asia Pacific
- Error using ==> mpower, Matrix must be square
- Direct link to this question
- Direct link to this question
- Answers (1)
- Direct link to this answer
- Direct link to this answer
- Direct link to this comment
- Direct link to this comment
- See Also
- Categories
- Community Treasure Hunt
- How to Get Best Site Performance
- Americas
- Europe
- Asia Pacific
- Squareing Matrix(?) in MATLAB
- Answers and Replies
Why do I get the error message ‘Matrix must be square.’ ?
Direct link to this question
Direct link to this question
Accepted Answer
Direct link to this answer
Direct link to this answer
2 Comments
More Answers (0)
See Also
Categories
No tags entered yet.
Products
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.
Источник
Matrix must be square error.
Direct link to this question
Direct link to this question
1 Comment
Answers (1)
Direct link to this answer
Direct link to this answer
0 Comments
See Also
Categories
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.
Источник
Why do I get the error message ‘Matrix must be square.’ ?
Direct link to this question
Direct link to this question
Accepted Answer
Direct link to this answer
Direct link to this answer
2 Comments
More Answers (0)
See Also
Categories
No tags entered yet.
Products
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 ==> mpower, Matrix must be square
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
See Also
Categories
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.
Источник
Squareing Matrix(?) in MATLAB
Hello, I’ve got quick questions.
1. When I have a matrix, x, and try to get different values for each x (given y = (x^2)+b),
I get this error.
? Error using ==> mpower
Matrix must be square.
2. x is [1×101] double according to MATLAB and I’ve had this problem when I was taking derivative as well. I’ve lost numbers throughout the derivative, which i understands.
so x’ = [1×100] and x» = [1×99] and so forth.
What’s the best way to solve these problems.
Thank you.
Answers and Replies
Hello, I’ve got quick questions.
1. When I have a matrix, x, and try to get different values for each x (given y = (x^2)+b),
I get this error.
? Error using ==> mpower
Matrix must be square.
2. x is [1×101] double according to MATLAB and I’ve had this problem when I was taking derivative as well. I’ve lost numbers throughout the derivative, which i understands.
so x’ = [1×100] and x» = [1×99] and so forth.
What’s the best way to solve these problems.
Thank you.
>> x=sqrt(500/105);
>> a=[0:0.1:100];
>> b=[0:1:100];
>> z=a/(2*(sqrt(3000*15)));
>> p=x(sqrt(1-((z)^2)))
? Error using ==> mpower
Matrix must be square.
this is not the direct problem but it’s basically the same thing.
Why am I getting this error?
I will hold onto my second question for now.
[edit] another question.
>> x=A*(exp(-(z*wn*t)))*(sin(wd*t))
? Error using ==> mtimes
Inner matrix dimensions must agree.
everything is numeric except t is in matrix.
>> x=sqrt(500/105);
>> a=[0:0.1:100];
>> b=[0:1:100];
>> z=a/(2*(sqrt(3000*15)));
>> p=x(sqrt(1-((z)^2)))
? Error using ==> mpower
Matrix must be square.
this is not the direct problem but it’s basically the same thing.
Why am I getting this error?
It looks like you are using the matrix power operator ^ where you should be using the array power operator .^ . The matrix power operator A^n multiplies the matrix A by itself n times, which means the number of columns in A must be equal to the number of rows in A, which means that A must be square (size(A) = [m x m] for some positive integer m). The array power operator A.^n raises each element of A to the nth power, and therefore has no restrictions on the dimensions of A.
>> x=A*(exp(-(z*wn*t)))*(sin(wd*t))
? Error using ==> mtimes
Inner matrix dimensions must agree.
everything is numeric except t is in matrix.
Источник