How can I apply vel_smoother to a 3D data?

조회 수: 2 (최근 30일)
Ahmed
Ahmed 2024년 3월 22일
댓글: akshatsood 2024년 3월 23일
My ip = 176 139 48, if I apply following command
ip0 = vel_smoother(ip,128, .03, 1);
The error appears
Error using horzcat
Dimensions of arrays being concatenated are not consistent.
Error in vel_smoother (line 8)
c=[cleft, c, cright];
Error in S2_3D_seismic_modeling (line 36)
ip0 = vel_smoother(ip,128, .03, 1);
How can i get a smoothed model?

답변 (1개)

akshatsood
akshatsood 2024년 3월 22일
편집: akshatsood 2024년 3월 22일
Hello @Ahmed,
The error you are encountering, "Dimensions of arrays being concatenated are not consistent", suggests that when attempting to concatenate arrays in the "vel_smoother" function (specifically on line 8 with "c=[cleft, c, cright];"), the dimensions of "cleft", "c", and "cright" do not align properly for horizontal concatenation.
Without seeing the full code of "vel_smoother", I can provide you with a general approach to troubleshoot and fix this issue. The goal of the "vel_smoother" function seems to be to smooth your input velocity model "ip" by applying some form of filtering or averaging.
Steps to Troubleshoot and Fix
1. Check Dimensions: Ensure that "cleft", "c", and "cright" have the same number of rows if you are trying to concatenate them horizontally. Use "size" or "length" function to check their dimensions before the concatenation line.
disp(size(cleft));
disp(size(c));
disp(size(cright));
2. Adjust Dimensions: If the dimensions do not match, you will need to adjust them. This might involve slicing arrays or changing how they are generated so that they align correctly.
3. Understanding Concatenation: Remember that for horizontal concatenation (using "[a, b, c]"), the number of rows must be the same. For vertical concatenation (using "[a; b; c]"), the number of columns must be the same.
If you can provide more details about the "vel_smoother" function, especially how "cleft", "c", and "cright" are being generated and what their intended dimensions are relative to "c", I can offer more specific advice.
I hope this helps.
  댓글 수: 4
Ahmed
Ahmed 2024년 3월 22일
@akshatsood Yes itis solved as I write in the previous comment, I just applied a loop for 3rd dimension. Do you think it is fine?
akshatsood
akshatsood 2024년 3월 23일
Hi @Ahmed, seems fine as now the dimensions tend to match. In case you require any additional assistance, please let me know.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by