<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>k-Wave User Forum &#187; Topic: Silent error messages because isfield on user defined class always returns false</title>
		<link>http://www.k-wave.org/forum/topic/silent-error-messages-because-isfield-on-user-defined-class-always-returns-false</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 11:19:39 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.k-wave.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.k-wave.org/forum/rss/topic/silent-error-messages-because-isfield-on-user-defined-class-always-returns-false" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "Silent error messages because isfield on user defined class always returns false"</title>
			<link>http://www.k-wave.org/forum/topic/silent-error-messages-because-isfield-on-user-defined-class-always-returns-false#post-7227</link>
			<pubDate>Wed, 12 Feb 2020 15:59:35 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">7227@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Chris,&#60;/p&#62;
&#60;p&#62;Thanks for the tip - that's useful. We'll add it to the bug list.&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ChrisBerk on "Silent error messages because isfield on user defined class always returns false"</title>
			<link>http://www.k-wave.org/forum/topic/silent-error-messages-because-isfield-on-user-defined-class-always-returns-false#post-7197</link>
			<pubDate>Fri, 24 Jan 2020 00:09:44 +0000</pubDate>
			<dc:creator>ChrisBerk</dc:creator>
			<guid isPermaLink="false">7197@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;I think I've found a few places in the code where, due to this odd behavior of the function &#60;code&#62;isfield&#60;/code&#62; which always returns false if called on a user defined class, a few error messages are silent. This mainly affects when &#60;code&#62;isfield&#60;/code&#62; is used to check fields on a kwaveTransducer used as a sensor or source.&#60;/p&#62;
&#60;p&#62;More info on this behaviour here: &#60;a href=&#34;https://uk.mathworks.com/matlabcentral/answers/94688-why-does-isfield-always-return-false-when-querying-a-user-defined-class-in-matlab-7-7-r2008b&#34; rel=&#34;nofollow&#34;&#62;https://uk.mathworks.com/matlabcentral/answers/94688-why-does-isfield-always-return-false-when-querying-a-user-defined-class-in-matlab-7-7-r2008b&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;The places I've been able to locate where this results in actual behavioral changes are:&#60;/p&#62;
&#60;p&#62;- In kspaceFirstOrder3DC, there is a check for record_start_index that never succeeds, so the command line option isn't propogated&#60;br /&#62;
- In kspaceFirstOrder_inputChecking, in the lines&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;% check that the transducer is only being used in forward mode
        if isfield(sensor, &#38;#39;time_reversal_boundary_data&#38;#39;)
            error(&#38;#39;Transducer inputs not supported with time reversal.&#38;#39;);
        end

        % check that sensor.record is not set
        if isfield(sensor, &#38;#39;record&#38;#39;)
            error(&#38;#39;sensor.record cannot be set when using kWaveTransducer objects as the sensor.&#38;#39;);
        end&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;the errors are never called even if the field is present.&#60;/p&#62;
&#60;p&#62;I've had a look through all of the other places that isfield is used, and I don't think there is any other shadowed behaviour, but it might be worth someone else taking a look as it is used a lot.&#60;/p&#62;
&#60;p&#62;Kind regards,&#60;br /&#62;
Chris
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
