How can I apply vel_smoother to a 3D data?

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?

Réponses (1)

akshatsood
akshatsood le 22 Mar 2024
Modifié(e) : akshatsood le 22 Mar 2024
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 commentaires

Ahmed
Ahmed le 22 Mar 2024
@akshatsood I did like this and working
for i = 1:48
ip0(:,:,i) = vel_smoother(ip(:,:,i),128, .03, 1);
end
akshatsood
akshatsood le 22 Mar 2024
Hi @Ahmed, please let me know if it the issue is resolved for now or if not, please help me with the implementation for "vel_smoother" function and the variable "ip".
Ahmed
Ahmed le 22 Mar 2024
@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 le 23 Mar 2024
Hi @Ahmed, seems fine as now the dimensions tend to match. In case you require any additional assistance, please let me know.

Connectez-vous pour commenter.

Catégories

Question posée :

le 22 Mar 2024

Commenté :

le 23 Mar 2024

Community Treasure Hunt

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

Start Hunting!

Translated by