Community Profile

photo

Hernia Baby


Last seen: Today
32 total contributions since 2021

Hernia Baby's Badges

  • First Submission
  • Knowledgeable Level 2
  • Solver
  • Revival Level 1
  • Thankful Level 1
  • First Answer

View details...

Contributions in
View by

Answered
nan in if statement
clc, clear a = NaN; if a==0 | isnan(a) %whatever a end a = NaN

14 dagar ago | 0

Solved


Find the numeric mean of the prime numbers in a matrix.
There will always be at least one prime in the matrix. Example: Input in = [ 8 3 5 9 ] Output out is 4...

14 dagar ago

Answered
Cody Problem 14. Find the numeric mean of the prime numbers in a matrix.
As Geoff Hayes says, variable 'in' is NOT string type. You can check the data type with class function. in = [8 3 5 9]; class...

14 dagar ago | 0

Answered
discretizeの使い方について
質問の回答 discretizeはあくまで数字をある閾値で分割してグループ分けするだけです。 次元を変えることはできないと思います。 たぶん解決案 おそらくdiscretize関数を使った後に、 それぞれの列ごとに変数を格納したいのだと思...

14 dagar ago | 0

Answered
for構文で出てきた変数にナンバリングする方法が知りたいです。
sprintf と evalの組み合わせで行いました。 しかしナンバリング自体はあまりお勧めしません。 for i = 1:100 n = 10; eval(sprintf('team_%i = randsample(%i,10);...

14 dagar ago | 2

Submitted


Extract and Join Matrix
Create new matrix with extracting Non-zero submatrix.

25 dagar ago | 0 downloads |

Answered
処理中が終わらない
おそらくメモリ不足です。 刻み幅がめちゃくちゃ細かいので、格納するデータ量も相当なものになると思います。 -------------------------------------------------------------- 以下検証 C...

ungefär en månad ago | 0

Answered
配列の垂直連結
あまりお勧めではないですが、eval関数を使ってください clear % 最初のデータ sample1=[1 2 3; 1 2 3; 1 2 3]; sample2=[2 2 3]; sample3=[6 2 3; 2 2 3]; sa...

ungefär en månad ago | 0

Answered
i have number i need save only integer without any point or 'e'
format % x = ATRTIMED(c) * 360 x = 3.700000e+02; x

ungefär en månad ago | 0

Answered
Element subtraction of same matrix
A = [2,5; 3,8]; B = [2-2, 2-5, 2-3, 2-8; 5-2, 5-5, 5-3, 5-8; 3-2, 3-5, 3-3, 3-8; 8-2, 8-5, 8-3, 8-8]; A = A'; Answ...

ungefär en månad ago | 0

Answered
グラフのy座標の値(1点)を返す関数ってありますか??
論理値によるインデックス付けをしてみてはどうでしょう? aを任意の値とします。 y(x==a) とすれば、x=aのときのyが返ってきます。 逆に bをyの任意の点として x(y==b) とすればy=b...

ungefär 2 månader ago | 0

Answered
Calculate Matrix and then use previously calculated matrix in next iteration
" i " is not the number but index number(line or row). e.g.1 using for clear; topog = 100:149; erodedSed = (0.1:0.1:5); n...

ungefär 2 månader ago | 2

| accepted

Answered
Simplifying with respect to trig identities to avoid dividing by zero
How about using logical indexing? function [ y ] = usinc( x ) ...

ungefär 2 månader ago | 0

Answered
A little question of [] and for loop
It is same as horzcat. https://jp.mathworks.com/help/matlab/ref/horzcat.html?lang=en A = 0; for i=1:50 A=horzcat(A,i); ...

ungefär 2 månader ago | 1

Solved


Make the vector [1 2 3 4 5 6 7 8 9 10]
In MATLAB, you create a vector by enclosing the elements in square brackets like so: x = [1 2 3 4] Commas are optional, s...

ungefär 2 månader ago

Solved


Add two numbers
Given a and b, return the sum a+b in c.

ungefär 2 månader ago

Solved


Times 2 - START HERE
Try out this test problem first. Given the variable x as your input, multiply it by two and put the result in y. Examples:...

ungefär 2 månader ago

Answered
Poctave return value Sound pressure or Sound power? who can help me
p = poctave(x,fs) returns the octave spectrum of a signal x sampled at a rate fs. The octave spectrum is the average power ov...

ungefär 2 månader ago | 0

Answered
How can I find maximum value within each columns and and return the entire elements in that column
This code seperates A to odd and even elements, and culculates B with logical indexing. A = [ 0.0596 0.0714 0.8181 0...

ungefär 2 månader ago | 0

| accepted

Answered
Plot surface from non-anonymus function
clc,clear,close all; w = [1:10;2:11]; x = w(1,:); y = w(2,:); f = @(x,y) 2*x.^2 + 2*y.^2 +10*(1.1*y.^2 +3*x.^2).^0.5; ...

ungefär 2 månader ago | 0

Answered
大きな二次元配列から不特定の間隔かつ特定サイズの二次元行列をfor loopを使わずに取り出す方法に関して
まずは下準備 clc,clear,close all; % 抜き出す部分行列はk×kとする k = 3; % ランダムな行列を作成 X = randn(11,12); % 図と同じ分布を作る A = zeros(11,12);...

ungefär 2 månader ago | 2

| accepted

Answered
doubleの行列を各セルに内包しているcell型変数の分解方法
エラーの原因はサイズの違いです。 i = 1で見てみると size(cell2mat(a(i))) は 1×45に対し、size(b(1,i))は1×1になります。 以下のように差し替えてみてください。 count5=1; for i=1:1...

ungefär 2 månader ago | 0

| accepted

Answered
How can I link data from separate arrays?
The code below is one I assumed from your infomation. Therefore, it might be different from what you want to do. As the other ...

ungefär 2 månader ago | 1

Answered
Get value from table/matrix based on common attribute
% input data A = {'Smith' 'John' '1001'; 'Taylor' 'James' '1004'; 'Thatcher' 'Mary' '1001'}; B = {'1001' 'New Yo...

ungefär 2 månader ago | 0

| accepted

Answered
Adding two matrixes with different row numbers.
Following your output image, out = [sum(A(1,:),B(1,:)); sum(A(1,:),B(2,:)); sum(A(2,:),B(1,:)); sum(A(2,:),B(2,:)); sum(A(3,:)...

ungefär 2 månader ago | 1

Answered
HI im kind of new to Matlab. What is the problem with my code displaying the error "Index exceeds the number of array elements (0)."
You will see F value on the work space. As Stephen Cobeldick says, F may have zero columns and non-zero rows.

ungefär 2 månader ago | 0

Answered
Converting Linear Equations to Matrix Form
You need to convert following form. X(i+1) = C*X(i) + a(i) Xo = [0 0 0 0]'; X(:,1) = Xo; C11 = 1; C21 = 2; C22 = 3; C3...

ungefär 2 månader ago | 0

Answered
my random changes its values during running my code
You can generate random numbers that are repeatable with saving and restoring the generator setting. rng(1,'twister'); mu=30...

ungefär 2 månader ago | 0

| accepted

Answered
Modifying odd/even numbers of a column vector
You can modyfiy each element with mod function. x = [4 5 7 6 5 8 2 1]; x_odd = x(mod(x,2)==1); % odd element x_even = x(...

ungefär 2 månader ago | 0

Answered
入力信号に0と1と無限大(inf)の3つの状態を持たせ条件判定に使いたいが。。。
「0 or 1 or inf」で判定させたいときは logical と isinf関数 を使います。 判定だけなら、これが使いやすい気がします。 【例】logical値で抜き出す場合(何行目にそれがあるか) idx = [0 0 1 inf 1 ...

ungefär 2 månader ago | 1

Load more