Skip to main content

Posts

Showing posts from July, 2023

Stretch the dynamic range of the given 8-bit grayscale image using MATL...

How to exist(obj.struct.var)?

  exist(obj.struct.var) always returns 0 regardless if the var exists or not. Answer: If you're not sure if the obj variable is a   struct  or has a field named struct, you can call   isfield  twice.   y = isfield(obj, 'struct') && isfield(obj.struct, 'var'); The first   isfield  call will return false if obj is not a   struct  or is a   struct  that does not have a field named struct. Only if the first   isfield  call returns   true  will the   short-circuit   &&  operator  cause the second   isfield  call to be evaluated. In fact, that documentation page includes an example (Change Structure Field Value) that is somewhat related to this question.   obj = 42; % Not a struct y1 = isfield(obj, 'struct') && isfield(obj.struct, 'var') % false obj = struct('abc', 'def'); % struct but without the correct field y2 = isfield(obj, 'struct') && isfield(obj.struct, 'var') % false obj = struct(&#

How to load files in numerical order?

  Hello everyone,   I am loading multiple dicom files from the same folder using the following code:   imagesFolder = uigetdir('C:\','Select your folder with DICOM files'); filePattern = fullfile(imagesFolder, '*.dcm'); theFiles = dir(filePattern); for k = 1 : length(theFiles) baseFileName = theFiles(k).name; fullFileName = fullfile(imagesFolder, baseFileName); fprintf(1, 'Now reading %s\n', fullFileName); imageArray = dicomread(fullFileName); end The problem is that I have my files numbered as follows: name1, name 2, ..., name10, name11, ..., name100, name101, etc. And when I load the files they are inserted in the 3D variable (in this case  imageArray ) with the following order: name1, name10, name100, name101, ..., name109, name11, name110, name111, etc. In my windows folder I see the files ordered. How can I load the files in order?   Answer: It has plenty of examples and help, so you should not have any problems using it. E.g.:   P = uigetdir(

wordEmbeddingLayers() available in Deep Learning Toolbox?

  Hello,   trying to run the  "Deep Beer Designer" , I got stuck on the use of  wordEmbeddingLayer()  which is flagged as an unknown function. The reason is probably that I am still on Matlab and Deep Learning Toolbox (DLT) R2018b, but it is not quite clear if  wordEmbeddingLayers  should or should not be available in this release. There are several Examples in the R2018b DLT Help which use it, but they do say that the  Text Analytics  Toolbox (TAT) has also been used (which is a little bit uncool, IMO :-)) . The " List of Deep Learning Layers " in the R2019 DLT Help says " wordEmbeddingLayer (Text Analytics Toolbox™) " (so why is it listed in the DLT at all?) Moreover: the  Release Notes  for the R2018b DLT  (both in the Help and online) under " Deep Learning: New network layers " state, somewhat confusingly, that "You can now use the following layers in deep learning networks: wordEmbeddingLayer ..." but with no mention of the need fo

data of matlab links

  https://www.matlabsolutions.com/resources/how-can-i-subscribe-to-image-topic-on-ros-matlab-and-obtain-the-rgb-image-.php https://www.matlabsolutions.com/resources/how-to-convert-bag-file-into-pcd-in-matlab-lidar-data-.php https://www.matlabsolutions.com/resources/how-to-remove-column-with-0-in-matrix-.php https://www.matlabsolutions.com/resources/how-to-delete-entire-row-of-an-array-.php https://www.matlabsolutions.com/resources/iteration-through-column-multiple-times.php https://technicalsource9.medium.com/how-can-i-subscribe-to-image-topic-on-ros-matlab-and-obtain-the-rgb-image-f482bfc729d3 https://technicalsource9.medium.com/how-to-convert-bag-file-into-pcd-in-matlab-lidar-data-6e5db116ba30 https://technicalsource9.medium.com/how-to-remove-column-with-0-in-matrix-efe0300e1543 https://technicalsource9.medium.com/how-to-delete-entire-row-of-an-array-936eff3ef17e https://technicalsource9.medium.com/iteration-through-column-multiple-times-abc5d8e3209a https://matlabarticlesworld.blogs